I'm trying to execute some batch file from java class. I want the batch to run without opening cmd window and I want to wait till it is completed.
When using the command below (without the backgroung) - it works perfectly:
String executeCmd = "cmd /c start /wait " +config.getJarPath()+ " --context_param Path=" +folderName;
final Process process = run.exec(executeCmd);
process.waitFor();
But when I'm adding the /b (run in background) the batch file is not running:
String executeCmd = "cmd /c start /B /wait " +config.getJarPath()+ " --context_param Path=" +folderName;
final Process process = run.exec(executeCmd);
process.waitFor();
Do you have any idea what can it be?
Thanks a lot