Friday, 9 November 2012

Shutdown Windows via Command Prompt

The shutdown command becomes more flexible and automated when used from the command prompt.  To run the shutdown command from the 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 east 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)

Examples
shutdown –m \\computername –r –f  This command will restart the computer named computername and force any programs that might still be running to stop.
shutdown –m \\computername –r –f –c “I’m restarting your computer.  Please save your work now.” –t 120  This command will restart the computer named computername, force any programs that might still be running to stop, give to user on that computer a message, and countdown 120 seconds before it restarts.
shutdown –m \\computername –a  This command will abort a previous shutdown command that is in progress.

Shutdown Command via Dialog Window
To open the dialog window click start, click run, type cmd and press enter.  A black DOS looking window will open.  Type shutdown -i and press enter.  A window similar to the one below will popup.



Under computers type the network name of the computer you want to shutdown, restart, or logoff.  In this example I will use \\yourcomputer.  You can use your computer’s name to try the commands on your computer if you like.

If you don’t know a computers name right click my computer, select properties, select the computer name tab.  Your computer name is listed next to full computer name.

NOTE : To send these commands to other computers across your network you need to have administrative privileges on those computers.  An easy way to see if you have administrative privileges on a networked computer is to try browsing to it.  Click start, click run, type \\yourcomputer (replace yourcomputer with your computer’s name of course) and press enter.  If you are able to access the computer you will be able to send shutdown commands to it.  If you get asked for a password or it denies access you don’t have administrative privileges and you won’t be able to send shutdown commands to that computer.

In this example I’m going to shutdown computer \\yourcomputer on my network.  Before it shuts down it’s going to show a message for 20 seconds.
The first thing you need to do is add which computer you want to shutdown.  Click add and type your computer name in the add computers box.




Reference : http://maximumpcguides.com/windows-vista/use-the-remote-shutdown-tool-to-shutdown-restart-or-logoff-a-local-or-networked-computer/


 

No comments:

Post a comment

Popular Posts