I have the following line to run a batch file,
Process process = Runtime.getRuntime().exec("cmd /c start rake.bat");
But I want it to run in the background and not display the command line to the user. How can I change it to do this?
The problem is that the command window opens and intrupts the programs GUI. I just want the command window to not be visible while it is executing the batch file.
Removing the ‘start’ completely will do what you want (as this is what is creating the window):
I have tested this and it works, ofcourse if you want to communicate with the command prompt you’d have to have Input and Output streams, also not forgetting your Error stream
As stated in the comment though removing ‘start’ on XP wont help (as it wont work).