Link to home
Start Free TrialLog in
Avatar of ibferoz
ibferoz

asked on

calling batch file from a java program


try{
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec("C:\\WINNT\\system32\\cmd.exe /c C:/AIDER1/tools/zip/run.bat");

    }catch(Exception ioe)
      {
        System.out.println("error!!!");
      }

it is running without any exception but not invoking the batch file.
Avatar of Venci75
Venci75

you won't get an exception in this case
the problem is in the path of the bat file.
try this:
Process p = rt.exec("C:\\WINNT\\system32\\cmd.exe /c C:\\AIDER1\\tools\\zip\\run.bat");

   
ASKER CERTIFIED SOLUTION
Avatar of nir2002
nir2002

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ibferoz:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
Avatar of girionis
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to nir2002

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer