Friday, October 24, 2014

This guide shows you how to use the shutdown command and its various switches to shutdown, restart, or log off local or remote computers from the command prompt and dialog window.

  1. Command Prompt

Go to start, run, type cmd, and press enter.  In the black box (the command prompt) type shutdown and the switches you want to use with the shutdown command.  You have to use at least one switch for the shutdown command to work.

The shutdown command has a few options called switches.  You can always see them by typing shutdown -? in the command prompt if you forget any of them.
-i: Display GUI interface, must be the first option
-l: Log off (cannot be used with -m option)
-s: Shutdown the computer
-r: Shutdown and restart the computer
-a: Abort a system shutdown
-m \\computername: Remote computer to shutdown/restart/abort
-t xx: Set timeout for shutdown to xx seconds
-c “comment”: Shutdown comment (maximum of 127 characters)
-f: Forces running applications to close without warning
-d [u][p]:xx:yy: The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536)

Note - I’ve noticed using a switch with a – sign doesn’t work sometimes. If you are having trouble try using a / in place of – in your switches.

   2.   Dialog Window


Type shutdown -i and press enter.  A window similar to the one below will popup.
Add Computer or List of computers by clicking Add button.







Given figure is an example for shutting down a computer  after displaying warning message 20 seconds for its users.

Note - To execute shutdown down command user should have administrative privileges in resulting computer.



Continue reading