Shutdown Windows Automatically – Command Prompt (CMD, DOS, Shutdown Command)

What We'll Learn:

This guide is all about automatic restarts or shutdowns from the windows command line.

  • We’ll start by learning, how to open the command prompt.
  • How to use create automatic shutdown timers using the Shutdown command.
  • How to restart our system or create restart timers from the command line.
  • How to cancel an accidentally scheduled shutdown.
  • And finally, we’ll take a look at a few other useful parameters for the shutdown command.

Lets get started!

Opening the command Prompt:​

To use the shutdown command to automatically shutdown or restart our system we must first open the command line.

There are lots of ways you can open the command prompt, the simplest however is to search for “Cmd” in your search bar and select the first result.

Automatically Shutdown Or Restart Windows Using The Command Line (CMD)

The command line should appear at once.
With the command line open we can now create our time.

Automatic Timer Using The Shutdown Command:​

To automatically shutdown your PC type the following into your command prompt:

shutdown /s /t 7200

Lets break it down:

  • The /s parameter tells our command to shutdown your system.
  • The /t specifies the time in seconds.

You can remove this parameter completely to shutdown your system in one minute.
Otherwise, adjust the value of this parameter to suit your needs. If you are unsure use the following cheat-sheet:

1 Hour = 3600.
2 Hours = 7200.
3 Hours = 10800.

X Hours = X * 3600.


Restart Your System Using The Shutdown Command:​

To automatically restart our system, instead of using the /s parameter we are going to use /r parameter which stands for restart or reboot, along with the /t parameter which specifies the time in seconds like i said before.

This is what the complete command  should look like:

shutdown /r /t 7200

To change the amount of time change the value of the /t parameter.

Cancel a shutdown or a restart:​

Change your mind? No problem.

To cancel a scheduled operation simply type the following into your command prompt:

shutdown /a

The /a parameter stands for abort, and it will cancel any scheduled timer at once.

Useful Parameters For The Shutdown Command:​

You can use the shutdown command to complete a variety of operations, here is a list of useful parameters.

  • /L Stands for logout and it can be used to logout the current user
  • /h Will hibernate your computer.
  • /f Will forcefully close any running applications before shutting down or rebooting.
  • And finally you can use /r followed by /o to restart your computer and launch the Advanced Start Options menu which is very useful for troubleshooting windows problems.

If you want the full list of parameters along with a brief description simply type:

help shutdown

A list with every available parameters should immediately appear.


  • Use the Shutdown command along with the /s and the /t parameter to create automatic shutdown timers.
  • To restart your system instead of turning it off, use the same command but replace the /s parameter with /r.
  • Use the /a parameter to abort a timer, /L to logout, /H to hibernate and /r along with /o to launch the Advanced Start Options menu.

That's It!

You now have the knowledge and the ability to create automatic shutdown timers, reboot, logout or hibernate your system from the command line as well as opening the advanced start options menu with just a simple command.

If you liked this short guide take a look at a few of our other posts related to the windows command line, or if you really liked it consider enrolling in our video course where you will learn the ins and outs of the Windows command Line.

Dont Stop Learning!

Windows Command Line Course!

This course has everything you need to start learning about the windows command line along with batch scripting.

Read More:

Any Questions? Ask them Below:

Leave a Reply

Your email address will not be published.

Take Your Skills to the next level!
Become one of our beloved students by enrolling into one of our courses. Get started now!


Take A Look At Our Command Line Course!

Need Help?

There's an easier way!


You are now officially on your way to becoming a genius!