I could understand the problem.
(1)With out using start, it is not working.
(2)After using start, I have also realized that the bat file is invoked from a different place from the one it is actually placed. In my case, it is called from C:\\Program Files\\apache-tomcat-6.0.18\\bin. So if the bat file contains any commands which are relative to the path it is located, it will not work
(3)Some thing like this will work
Runtime.getRuntime().exec("cmd.exe /c start C:\\templatefileadjustment.bat");
Note that the spaces in path will give an error and so I had placed my bat file right under C:
|