How To Shutdown Windows From Command Line with Shutdown Command Examples and Tutorial


Windows operating systems provides the shutdown command which have a lot of functions like reboot, shutdown, logoff etc. In this tutorial we will look most useful of them. Windows XP is very old operating system where it may lacks some of options and features described here. We will use cmd.exe to run from cli.


shutdown command syntax is like below.

  • OPTIONS is used for different type of options like restart, logoff etc.
  • COMPUTER is used when we need to run shutdown command on remote computer
  • COMMENT is used with comment feature to provide message

Shutdown System

Now the main purpose of shutdown command is shutting down the system or computer. Just providing the shutdown command is not enough. We should provide the /s option in order to shutdown the system.

Restart System

We can also restart system with the shutdown command. We will provide the /r option in order to restart the system or computer. This will shutdown and restart the computer.

Logout From Current GUI Session

If we have logged in with the GUI we may need to logout from current session. We will use /l option in order to logout from current user session.

Abort System Shutdown

By default when we issue shutdown command the computer will not shut down immediately. There is 60 seconds wait time before shutdown. We can cancel the shutdown operation with /a which means abort.

LEARN MORE  How To Shutdown Linux System

Hibernate System

Hibernate feature will make computer sleep and wake up in seconds without starting from scratch. We can hibernate the computer with the /h option like below.

Send Message To System Users

A typical server will be used more than one person. There may be other persons who is using server currently. We need to provide information about shutdown, restart. We can use /c option with the message. Message will be put into double quotes.

shutdown /s /c “The system will be shutdown in 60 seconds.”

Specify Time or Interval For  Shutdown and Restart

Default shutdown interval or time may be enough for us or other computer and system users. We can specify the interval we need with the /t option and time value. In this example we will specify waiting time for 120 seconds for shutdown. Merging this option with send message will be very useful.

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)