Shutdown computer with message
- From: christopher_board@xxxxxxxxxxx
- Date: Thu, 30 Aug 2007 14:30:18 -0700
Hi all. I am currently developing a java program that will shutdown
computers which are connected to a network. I have a function that is
able to shutdpwn the computer with a shutdown message by passing code
to the command prompt. The shutdown type that I am using for the
command prompt would be
shutdown -m \\computername -r -c "shutdown message" -f.
The -c set what the shutdown message is going to be.
If I run the program and in the box type Hello it works fine and
shutsdown the computer, however if I type Hello World it stops the
program from being able to be shutdown, however if I put HelloWorld
the programs works fine again and shuts the computer down showing the
message. It doesn't seem to like a shutdown message with spaces in.
The code that I am using to perform this shutdown is below:
try {
Runtime.getRuntime().exec("shutdown -m \\\\"+
remoteshutdown.mainScreen.lstComputerNames.getSelectedValue()+ "
-r -t 30 -f -c " remoteshutdown.mainScreen.txtShutdownMsg.getText());
} catch (Exception ex) {
System.out.println("Fail to ShutDown" + ex.toString());
}
Any help in this matter would be highly appreciated.
Thank you
.
- Follow-Ups:
- Re: Shutdown computer with message
- From: Roedy Green
- Re: Shutdown computer with message
- From: Thomas Fritsch
- Re: Shutdown computer with message
- From: Real Gagnon
- Re: Shutdown computer with message
- Prev by Date: Re: Newbie - JAR question
- Next by Date: Re: Shutdown computer with message
- Previous by thread: Newbie - JAR question
- Next by thread: Re: Shutdown computer with message
- Index(es):
Relevant Pages
|