Windows provides a builtin command to shutdown, restart as well as logoff a user from the command promptne. This and many other options are provided by the “shutdown” command. In order to find out more options of any command, type :
shutdown /? – command name followed by a forward slash and a question mark.
in Command Prompt ( WIN + R » cmd – here are some more Windows Keyboard shortcuts. You can run any command from Command Prompt or typing the command with full option into the RUN Dialog ( WIN + R ) The main use of all these commands come in batch files and task scheduling. All of these commands are pretty easy to use, please read the article completely before complaining
shutdown -s -t 120
The screen result will be something like this :
shutdown -s -t 120 -c “You are so screwed”
will present the user with the message – “You are so screwed” as below :
Microsoft Windows offers several ways to shut down or restart your computer, one of which is via the command prompt.
To access the command prompt window from Vista or Windows 7:
To shut down your computer type: shutdown /s
To restart your computer type: shutdown /r
To log off your computer type: shutdown /l
For a complete list of options type: shutdown /?

REFER AJEETH SARAVANA DASS
shutdown /? – command name followed by a forward slash and a question mark.
in Command Prompt ( WIN + R » cmd – here are some more Windows Keyboard shortcuts. You can run any command from Command Prompt or typing the command with full option into the RUN Dialog ( WIN + R ) The main use of all these commands come in batch files and task scheduling. All of these commands are pretty easy to use, please read the article completely before complaining

Contents
Basic form of “shutdown”
The most basic form of the command is :
shutdown -OPTION
OR
shutdown /OPTION
Both perform the same thing – execute shutdown command with option
OPTION. OPTION can take many values, only the ones of interest to us are
mentioned here.OR
shutdown /OPTION
-l – Logs off the current user
-s – Shutdown the computer
-r – Restart the computer
-s – Shutdown the computer
-r – Restart the computer
-a – Aborts a current shutdown command execution
-t XX – if this
is added with any of the above ones, you can specify after what time (
XX seconds ) the system should execute the OPTION.
A Simple example and a Screenshot
Here the OPTIONs specify that shutdown command should shutdown the command after 120 seconds.
RUNning “shutdown” command with options -s -t 120
The screen result will be something like this :

Before shutdown, the logged in user is warned about the event and the time frame.
Canceling a shutdown
If you have given the time parameter -t XX you will have sometime before the command kicks you out. In that time, if you want to cancel the event just type :
shutdown -a -Abort a shutdown

shutdown Aborted – notification
Add a message
You can add a custom message with shutdown so that, instead of the time frame warning, the user will be presented with your message.shutdown -s -t 120 -c “You are so screwed”
will present the user with the message – “You are so screwed” as below :

Custom message with “shutdown”
OR
USE THIS WAY
To access the command prompt window from Vista or Windows 7:
- Go to the Start menu
- Type cmd in the Search field
- Press Enter
- Click the Start menu
- Choose Run
- Type cmd
- Press Enter
To shut down your computer type: shutdown /s
To restart your computer type: shutdown /r
To log off your computer type: shutdown /l
For a complete list of options type: shutdown /?

REFER AJEETH SARAVANA DASS