Hi all, I need to call an exe file from java. I tried to do like this: Runtime rt = Runtime.getRuntime(); rt.exec("myfile.exe"); it does not call my exe at all.even i tried out with simple .bat file. I am working on windows NT. Help please, Thanx in advance, Vinod Pai
Kiran Kumar
Ranch Hand
Joined: May 18, 2001
Posts: 107
posted
0
put your exe or bat file in the path of the OS. put the path to ur .exe in the path environment variable. then runtime.exec will be able to execute it. like path = c:\temp\myexe.exe;
Thanks<br /> <br />Kiran <br /> <br />SCEA, SCJP 1.4,<br /> <br />"First they ignore u, then they laugh at u, then they fight u, <br />then u will win<br /> <br />Mahatma Gandhi"
Steve Deadsea
Ranch Hand
Joined: Dec 03, 2001
Posts: 125
posted
0
And if your path has spaces in it, make sure you call it like this: Runtime rt = Runtime.getRuntime(); rt.exec(new String[] {"c:\my stuff\myexe.exe"});