I'm trying to read exit value from external program but it's always 0.
String command = ("cmd /c start /wait "+ Script[0]);
Process exec = runtime.exec(command);
int waitFor = exec.waitFor();
System.out.println(exec.exitValue); //always 0
System.out.println(waitFor); //always 0
Program is used for programming modules and I need to know if there were any error's.
How to get the application exit value?