How to execute *.BAT file from the Java Application
Hello to all.I wants to run *.BAT file form my applicaion.Can u give the code of that two-four line,pleaseWating four your replay.Yours FriendBhavin Shah.....
[200 byte] By [bhavinshah20a] at [2007-9-28 11:29:39]
HI you can execute the .BAT file from java application by using the Runtime class.below is the sample code.Runtime rt=Runtime.getRuntime();Process pr=null;pr=rt.exec("cmd.exe /c start "+deleteReport+" "+fDest);
pr = rt.exec("cmd.exe /c start " + yourProgramName)The exec() method executes the command you specify in the argument and returns a process. In this example, it's telling Windows to run "yourProgramName".HTH
Hello yawmark when i run my prog. , i get following error.CreateProcess: cmd.exe /c start JavaEmailProxy.PIF error=0Press any key to continue . . .What is cmd.exe /c startThanks...