When I exec an application, a cmd window with a helloworld app that spits out the
string "Hello World", I can't actually see the cmd window. I'm using the '/k' flag, which if I understand correctly, should keep the cmd window open. I've also tried exec'ing a text file in notepad.
In both cases, I could see a cmd/notepad process start in the Process Window of the Task Manager, but the windows never actually popped up.
Anyone know why? Below is a snippet of my code.
thanks,
brian
String path = "d:\\";
String command = "cmd /k
java -classpath \"" + path + "\" HelloWorld";
Process p = Runtime.getRuntime().exec(command);
- OR -
String command = "notepad c:\\text.txt";
Process p = Runtime.getRuntime().exec(command);