Set a timer for windows shutdown and restart from command line without using any software.

If you are like me, who likes to listen to songs at night or when feeling sleepy, you probably get asleep without turning songs and computer off. To solve this ‘problem’, you have two options. One, stop listening to songs. Okay, sorry! I was joking. The other option is, tell your computer to turn itself off when you fell asleep. We take the second option, of course. But the computer isn’t intelligent enough to detect when you’re asleep and when you’re awake. So, now? Set a timer for Windows shutdown and restart, as simple as that. The best part is, you don’t need a software!

timer for shutdown


1. Open notepad from Start Menu -> Programs -> Accessories.

2. Type “shutdown -s -t <time is seconds for which system will wait before shutdown>”

eg. shutdown -s -t 3600

3. Save the file as “.bat” extension. A batch file is created.

Done! Now, just double-click the file before you start listening to songs and it will automatically shutdown after the time specified in step 2.


If you want the computer to restart after a specific time, there is a trick for that too. Follow the steps.

1. Go to Start Menu -> Programs -> Accessories and open Notepad.

2. Create a “.bat” extension file with “shutdown -r -t <time is seconds for which system will wait before shutdown>” as content.

That’s it! Same as above, the windows will restart after the number of seconds you specified in the file. You just need to double-click it.

Bonus Tip: Type “shutdown /help” in command prompt for more options on this shutdown command

If you think creating a file might cause “accidental” shutdown and restart because someone could click them to see what it is – don’t worry. You can do this without creating a batch file.

  1. Go to Start Menu -> Run (or press windows key + R)
  2. Type cmd and hit enter.
  3. In the command prompt window, type “shutdown -s -t XXXX (XXXX is time in seconds)” (with:ut quotes)
  4. Hit return. You’re done.

Example And Screenshot:

“shutdown -s -t 3600” (Windows will shutdown in an hour)

Another Tip:

Accidentally initiated the command? Don’t want the PC to shutdown? Don’t panic!

To abort the shutodown, type shutdown -a in the command prompt and hit return. Phew!

If you experience and problems, or have a better trick to shutdown windows without using any software, tell us in your comments below.

11 Replies to “Set a timer for windows shutdown and restart from command line without using any software.”

  1. if u are using command promt and help shutdown and get a different command for windows shutdown and restart,heibernet,switch user,logoff
    shutdown /s /t 0 for system shutdown
    restart /r /t 0 for syatem restart
    heibernet /h /t 0 for heibernet

  2. Hello sir, when i use “net send” command to send the message to my friend then a message is come up “the message alias could not be found” so ,sir what is the snlution for this? Plz send me plz sir.

  3. once you set the timer i don’t think you can stop the shutdown process,anyway i will try and find if there is a way to do that

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.