Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's Wrong Here?
Message
Information générale
Forum:
Visual C++
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00549825
Message ID:
00551440
Vues:
13
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform