I have a batch file called 'StartUpdate.bat' which contains something like this:
set CLASSPATH="myclasspath"
java -cp %CLASSPATH% UpdateProgram
runMyApp.bat
If I run 'StartUpdate.bat' directly from command line, it executes UpdateProgram and then runMyApp.bat immediately after. This is the intention.
However, if I call 'StartUpdate.bat' from another Java program, it terminates immediately after completing UpdateProgram. 'StartUpdate.bat' is called from this other Java program using
Runtime.getRuntime().exec(path + "StartUpdate.bat");
StartUpdate.bat is executed just fine, as is UpdateProgram inside it, but nothing else following UpdateProgram.
Why does it behave this way? What should I do so that it executes the remainder of the batch file?