Re: Shutdown computer with message
- From: Thomas Fritsch <i.dont.like.spam@xxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 01:31:05 +0200
christopher_board@xxxxxxxxxxx wrote:
Runtime.getRuntime().exec("shutdown -m \\\\"+It is usually more reliable to command-splitting by yourself, instead of letting Runtime#exec do the command-splitting. Try this:
remoteshutdown.mainScreen.lstComputerNames.getSelectedValue()+ "
-r -t 30 -f -c " remoteshutdown.mainScreen.txtShutdownMsg.getText());
String[] cmdArray = {
"shutdown",
"-m",
"\\\\" + remoteshutdown.mainScreen.lstComputerNames.getSelectedValue()
"-r",
"-t",
"30",
"-f",
"-c",
remoteshutdown.mainScreen.txtShutdownMsg.getText()
};
Runtime.getRuntime().exec(cmdArray);
--
Thomas
.
- References:
- Shutdown computer with message
- From: christopher_board
- Shutdown computer with message
- Prev by Date: Re: Newbie - JAR question
- Next by Date: How do I put my Java program online as an applet?
- Previous by thread: Re: Shutdown computer with message
- Next by thread: Re: Shutdown computer with message
- Index(es):