How do I shutdown

I've been using Remote Desktop Connection to get into a workstation, but I'm not able to use the shutdown/restart function in the Start menu while doing this.

I've put a few really helpful options in the answer below.

Note: I wanted to make sure some really good answers were also mentioned along with my own on this.

And here they are in no particular order.

  • Force the shutdown from JosephStyons
  • Executing the DLL file from VonC
  • Run it from the Run Box from Dean
  • Remote Shutdown from Kip

  • Here's how to do the shutdown functions via a batch file:

  • shutdown -r — restarts
  • shutdown -s — shutsdown
  • shutdown -l — logoff
  • shutdown -t xx — where xx is number of seconds to wait till shutdown/restart/logoff
  • shutdown -i — gives you a dialog box to fill in what function you want to use
  • shutdown -a — aborts the previous shutdown command....very handy!
  • shutdown -h — hibernate. Easy mistake - it's not for help
  • shutdown -y — Removes all prompts at shutdown (Help not available in any documentation)
  • Additional options:

  • -f — Force the selected action
  • -t <seconds> — Set time to shutdown. Use -t 0 for "now"
  • -c <message> — Adds Message to Shutdown

  • If you are on a remote machine, you may also want to add the -f option to force the reboot. Otherwise your session may close and a stubborn app can hang the system.

    I use this whenever I want to force an immediate reboot:

    shutdown -t 0 -r -f
    

    For a more friendly "give them some time" option, you can use this:

    shutdown -t 30 -r
    

    As you can see in the comments, the -f is implied by the timeout.

    Brutus 2006 is a utility that provides a GUI for these options.


    No one has mentioned -m option for remote shutdown:

    shutdown -r -f -m machinename
    

    Also:

  • The -r parameter causes a reboot (which is usually what you want on a remote machine, since physically starting it might be difficult).
  • The -f parameter option forces the reboot.
  • You must have appropriate privileges to shut down the remote machine, of course.
  • 链接地址: http://www.djcxy.com/p/6336.html

    上一篇: PHP中的异步shell exec

    下一篇: 我如何关机