Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's Wrong Here?
Message
General information
Forum:
Visual C++
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00549825
Message ID:
00551440
Views:
18
>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
Map
View

Click here to load this message in the networking platform