Hi all,
I was looking for a way to execute windows batch file from java code, and I was able to do this with the following code.
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("cmd /C " + "path" +exec.bat");
The batch file refers to some other files and executables in current directory and using relative path.
Since the java program is executed from a path different from the location of the batch file, the batch program cannot find the files/executables it is referring to
This leads to the batch program creating errors like
ERROR>>Could Not Find D:\xxx\Build App\BuildApp\xxxx.img
etc.....
Pls note :
D:\xxx\Build App\BuildApp\
is the path from where the java program is executed.
Can any one propose a solution for this.