Hi, I have a scenario where i have to "invoke a batch file which internally invokes ant" from a java program.I used Runtime proc= Runtime.getRuntime(); Process process=proc.exec("cmd /c <batch file path>"); process.waitFor();
it is not opening a new command prompt window and also the batch file is not being processed. Can any one throw light in this aspect.
Thanks in Advance.
posted 12 years ago
Using the following code will ensure the execution of the batch file unless a proper path is not provide.
Ensure the execution of the batch by running it first in command prompt and then try with the program. You never know what errors are thrown.