This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi all I want to execute a daemon process from a java program. but Runtime.getRuntime.exec(scriptName) is not starting the process., where the scriptName is a batch file in NT and a shell script in Unix. There are no exceptions also thrown..The same works well when I am passing and exe file say Notepad.exe in place of the daemon process script name Thanks in advance Sekhar
Try using something like this: Runtime.getRuntime().exec("cmd /K start run.bat"); Runtime.getRuntime().exec("cmd /K del run.bat"); (You can look in Windows help under cmd or command for the /K and /c options)
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Nov 09, 2001
Thanks a lot Cindy..Its working now. ..I hope something similar works for shell scripts also...
Joined: Sep 29, 2000
I am no Unix person - but I think that the syntax is almost the same . . . There is a cmd.exe in unix (don't know about the options). Try: (cmd start whatever.sh)