timer for shutdown

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 thoughts on “Set a timer for windows shutdown and restart from command line without using any software.

  • August 22, 2018 at 12:29 am

    Thanks for finally writing about >Set a timer
    for windows shutdown and restart <Liked it!

  • September 25, 2012 at 4:16 pm

    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

  • April 11, 2010 at 12:14 pm

    not workin in college lab…………

  • September 28, 2009 at 12:40 am

    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.

  • December 26, 2007 at 9:39 pm


  • September 3, 2007 at 9:17 pm

    Hey admin you can do that i mean stop the timer by using this move>>

    Start > Run > Shudown -a

    and it’ll be removed

  • July 7, 2007 at 9:23 pm

    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

  • July 7, 2007 at 5:19 pm

    man its kool, but how to turn it off 😉

    • May 5, 2010 at 1:26 pm

      shutdown -a
      yo abandon the process


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.