[Runtime] code de retour = 1
bonjour,
j'ai un petit fichier .bat (sous windows) et j'aimerais le lancer avec java.
Ce fichier lance lui aussi un programme java.
fichier :
Code:
1 2 3
|
java xmlya %1 enCours
java xmlya %1 termine |
(d'ailleurs si vous avez une instruction pour imprimer sur l'écranen passant ;) )
et je le lance comme ca avec un autre programme java :
Code:
1 2 3 4 5 6 7
|
Runtime r = Runtime.getRuntime();
try{
//Process p3 = r.exec(new String[] {processusPath + processusExecutable," 412"});
//p3.waitFor();
//System.out.print(p3.exitValue());
Process p2 =r.exec("C:\\Documents and Settings\\user1\\javaworkspace\\xmlya\\batch_test.bat 412"); |
(j'ai tester le batch tout seul en ligne de commande : pas de problèmes)
Merci