When executing some command(let\'s say \'x\') from cmd line, I get the following message: \"....Press any key to continue . . .\". So it waits for user input to unblock.
I had the same problem and I found a solution. It ins´t the most elegant, but it works.
1 - when you execute the process, you get the inputStream from the process 2 - Then you make a loop receiving the message shown in the prompt, if there was one 3 - When you see that you got from "prompt" the "press a key to continue", or whatever, you end the proccess
// Creates the runtime and calls the command
Process proc = Runtime.getRuntime().exec(Destino);
// Get the proccess inputStream
InputStream ips = proc.getInputStream();
String output = "";
int c = 0;
// Read the output of the pro
while ((c = ips.read()) != -1
&& !output.contains("Press any key to continue")) {
output = output + (char)c;
}
// Destroy the proccess when you get the desired message
proc.destroy();