When I execute the batch file directly in DOS, everything runs as expected. But when I execute the batch file from Java runTime, it will run only the commands that invoke jar files (ie. invoke the JVM). It does not run any native dos commands.
One problem is that I have no console to know why this is happening. I'm wondering if it's a permissions problem, but I have no idea. Anyone out there see this before?
The Java code used looks something like this:
Runtime.getRuntime().exec("c:\targetFolder\myBatch.bat"); // (Edited here for simplicity.)
The batch file looks something like this (noting that I've simplified it):
myBatch.bat:
call java myJar.jar blah blah --- yes
copy outputFile.out outputFile.bak --- NO
mkdir testDir --- NO
call java myJar.jar blah blah --- yes
call someOther.bat --- NO
The ---yes lines run fine and I see the expected results
The ---no lines do not run, but I have no idea why not b/c there is no console to tell me.
Thanks for any help!! Mike