Runtime.Exec with cmd and problem in waitFor
807569Jun 7 2006 — edited Jun 8 2006Hi
I am running
Process p1 = Runtime.getRuntime().exec("cmd /c start /min <some.exe> <args to exe>");
then I am checking
Int ExitVal = p1.waitFor;
If (ExitVal != 0) and so on.
However, the problem is that the p1.waitFor does not really block the thread. It returns 0 and the program continues even though the some.exe has still not completed its execution.
My guess is that Java is giving the exitcode of cmd.exe and not some.exe.
If this analysis is correct, I am stumped. How do I get the exit code of some.exe?
If my analysis is wrong, please help me in the right direction.
Regards
Shreekar