General information
Category:
Coding, syntax & commands
>string command="cls";
>Process proc = runtime.getRuntime().exec(command);
>
>Any idea why this won't work?
What do mean by won't work? Does it display an error message? The program crashes? It doesn't do anything?
Because quite frankly, it should work. I've never tried this but your code seems well written (grammatically correct.) The only thing I would try, probably if you get a message like "The name specified is not recognized as a...", is to put the entire path for the "cls" program in the command because Java's exec function might not respect the PATH environment variable.
Other than that, tell me what happens when you try it and I'll see if I can be of any help.
Good luck, Stephane.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only