1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| StringBuilder out = new StringBuilder();
StringBuilder err = new StringBuilder();
Shell shellobj = new Shell();
shellobj.setCharset("cp850");
try {
shellobj.command("start monDossier\\monExe -x -y").output(out).error(err).consume();
//shellobj.command("arp -d *").output(out).error(err).consume();
//shellobj.command("dir .45.").output(out).error(err).consume();
} catch (IllegalStateException e){
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// lecture des messages de retour
// => ne focntionne pas
if (!out.toString().equals("")){
consoleAddLine(out.toString(), normalStyle);
}
if (!err.toString().equals("")){
// => ne focntionne pas
consoleAddLine(err.toString(), alerteStyle);
} |
Partager