exec() and *.bat

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mirko

    #1

    exec() and *.bat

    can anyone resolve my problem?

    Runtime.getRunt ime().exec("run .bat")

    it does not start the program in windows??why ?it only starts the *.exe
    files


  • Nathan Zumwalt

    #2
    Re: exec() and *.bat

    I'm not sure what your question is but... it sounds like you're
    expecting a window to pop-up when you execute your batch file. If the
    batch file is just a console program (no Windows GUI), then you won't
    see any windows... the program will execute and return. Check out the
    java.lang.Proce ss class (this is what is returned from your call to
    the exec method).

    //Nathan

    "mirko" <hmmm@mhhhhh.ko m> wrote in message news:<charvq$js 0$1@bagan.srce. hr>...[color=blue]
    > can anyone resolve my problem?
    >
    > Runtime.getRunt ime().exec("run .bat")
    >
    > it does not start the program in windows??why ?it only starts the *.exe
    > files[/color]

    Comment

    • bread

      #3
      Re: exec() and *.bat

      u should specific the full path ..

      eg:
      Runtime.getRunt ime().exec("C:\ run.bat")



      "mirko" <hmmm@mhhhhh.ko m> ¦b¶l¥ó news:charvq$js0 $1@bagan.srce.h r ¤¤¼¶¼g...[color=blue]
      > can anyone resolve my problem?
      >
      > Runtime.getRunt ime().exec("run .bat")
      >
      > it does not start the program in windows??why ?it only starts the *.exe
      > files
      >
      >[/color]


      --
      ~ Samba, more than a low cost File and Printer server ~

      -- Let us OpenSource --


      -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
      http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
      -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

      Comment

      • Wim Hoogendam

        #4
        Re: exec() and *.bat

        I think you need to start a command box to run the bat file.

        try something like this:

        Runtime.getRunt ime().exec("cmd /c start run.bat")

        Wim


        "mirko" <hmmm@mhhhhh.ko m> wrote in message
        news:charvq$js0 $1@bagan.srce.h r...[color=blue]
        > can anyone resolve my problem?
        >
        > Runtime.getRunt ime().exec("run .bat")
        >
        > it does not start the program in windows??why ?it only starts the *.exe
        > files
        >
        >[/color]


        Comment

        Working...