Re: Shutdown computer with message



christopher_board@xxxxxxxxxxx wrote:
Runtime.getRuntime().exec("shutdown -m \\\\"+
remoteshutdown.mainScreen.lstComputerNames.getSelectedValue()+ "
-r -t 30 -f -c " remoteshutdown.mainScreen.txtShutdownMsg.getText());
It is usually more reliable to command-splitting by yourself, instead of letting Runtime#exec do the command-splitting. Try this:

String[] cmdArray = {
"shutdown",
"-m",
"\\\\" + remoteshutdown.mainScreen.lstComputerNames.getSelectedValue()
"-r",
"-t",
"30",
"-f",
"-c",
remoteshutdown.mainScreen.txtShutdownMsg.getText()
};
Runtime.getRuntime().exec(cmdArray);

--
Thomas
.