Shutdown windows computer from command line

by admin on April 17, 2011

We can shutdown a Windows computer  using shutdown command.  This command works on all Windows editions : XP, Vista, Windows7, Server 2003 and Server 2008. See the syntax for this command below.

Shutdown -s

The above command opens a small window which displays a 30 seconds counter to start shut down of the computer. You can change the timeout by using -t option. For example, to wait for 120 seconds and then trigger shutdown, the command would be:

shutdown -s -t 120

If you want to display a message in the shutdown dialog, you can use -c option.

Ex:

shutdown -s -c "This is test run of shutdown command"

How to abort shutdown of the computer?

Even after ‘Shutdown -s’ command is executed, we can still stop the shutdown if required. We need to run the below command for this.

Shutdown -a

Shutdown works on all the Windows editions – XP, Vista, Windows 7, Server 2003 and Server 2008 editions.

Error messages:
If you do not have privileges to reboot the computer, you will get the below error message.

C:\>shutdown -s
The operation completed successfully.
A required privilege is not held by the client.

How to shutdown windows without any time out period or waiting?

We can use -p flag to indicate that shutdown of the computer should start immediately. This will not send out any message or warning to the other logged in users of the system(remotely if any).

shutdown -p

Shutdown and restart the Windows computer

For this we can use -r flag. The command for restarting windows computer is given below.

shutdown -r

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: