Shutdown computer with message



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

.



Relevant Pages

  • Re: Sasser like Shutdown and no Task Bar
    ... Right now I am trying to tell him how to stop the shutdown. ... Associate Expert - WindowsXP Expert Zone ... > | Task Manager using ctrl+shift+escape and click "new task" on the ... > shutdown message. ...
    (microsoft.public.windowsxp.general)
  • Re: shut downs
    ... When you get the shutdown message, ... If you are using WinME or WinXP, disable System Restore ... Reboot your PC into Safe Mode and shutdown as many applications as possible ...
    (microsoft.public.security.virus)
  • Re: system auto reboot
    ... When the shutdown message appears: ... This will halt the shutdown. ... through windows update and not using a firewall. ...
    (microsoft.public.windowsxp.general)
  • Re: RPC Error
    ... you get the shutdown message again, click Start -> Run, then type ... "Shutdown -a" and click OK to cancel the shutdown. ... > completing the setup procedure, ... > corrective action will be taken in 60000 milliseconds: ...
    (microsoft.public.windowsxp.general)
  • Re: Sasser worm removal tool from Microsoft available
    ... Welcome to Sasser ... When you get the shutdown message go to ... This will abort the shutdown in progress. ...
    (microsoft.public.security.virus)