Technology Tutorials

How to automatically shutdown your PC using the Command Prompt

Many of us, have already experienced this, that we had to leave our computers but there are some running programs or task that still need to run and finish, maybe its your Anti-Virus running, you’re Downloading something or Defragmenting or any task your doing with PC wherein you can’t just leave the computer running all day while you’re out so you have to wait for that task or program to finish, or maybe some of us will just leave the computer running all day, even if you already know that the program or task that you’re running we’ll be done in an hour… and that sucks. Too much electricity was wasted.

Though many 3rd Party Programs offer scheduled shutdowns but not all, what i’ll be teaching here is how to automatically set your computer to shutdown without using any 3rd Party Programs, you’ll just need Windows Command Prompt (every Windows PC has it) and your set to go.

1. Accessing the Command Prompt:

Running the Command Prompt from Start Search
Running the Command Prompt from Start Search

There are many ways to access the Command Prompt so for those who don’t know how to access it, here are some ways you can do to open the Command Prompt.

  • You open the command prompt by going to Start Menu > All Programs > Accessories and there just look for the Command Prompt below Accessories.
  • Another option is to open Run… and then type cmd, press Enter, then the Command Prompt we’ll open.
  • Last option is to run it from the Start Search (Only Vista and Windows 7 has it) just type on the Start Search, cmd then press Enter and you’ll see the Command Prompt running in no time. (This is my usual technique in accessing almost every program i want to run.)

2. What to Type on the Command Prompt?

  • Type shutdown /t number-in-seconds /s
  • the number-in-seconds will be replaced on how long you want the shutdown to take place, but you have to convert it in seconds. so if you want to 1 Hour before the automatic or scheduled shutdown takes place you have to replace in the number-in-seconds, 3600
  • Since 3600 / 60 = 60 and 1 minute = 60 seconds that’s why 3600
  • So for 30 minutes = 1800
  • 2 hours = 7200, 3 hours = 10800 and so on and so fourth (I hope you already understand it)
  • To have a better view i’ve attached a Screenshot, wherein it shows that i want my computer to shutdown in 10 minutes so i replaced the number-in-seconds to 600, since there are 600 seconds in 10 minutes.
Shutting down your PC automatically using the Command Prompt
Shutting down your PC automatically using the Command Prompt

After entering the values on the Command Prompt, a System Prompt will show saying that your computer will shutdown in whatever values you have set in there. Just like on the Screenshot above.

Please be aware that once it is activated it can’t be changed or turned off unless you manually restart your PC or Shut it down, then everything that you’ve have set will be gone and be back to normal.

By Wilhelm Jourdan

Web / Graphic / UI / UX Designer, IT Consultant and a Tech Enthusiast from the Philippines... been in the Web & Tech Industry for 5 Years.

Wilhelm loves to dance and enjoy his free time together with his family.

1 reply on “How to automatically shutdown your PC using the Command Prompt”

I was wondering if this could be taken a step further. My problem is this: Often times other people at my work get on my computer after I have left or while I’m gone over the weekend (or out on vacation) to find things they need before I get back. Unfortunately none of them are smart enough to locate the “Shutdown” option when they are finished. So my computer will remain on until I get back. I was going to make a quick program in Visual basic that would start in the background when the computer is turned on and every X hours a popup will appear saying, “The computer will shut down in X seconds.” With the option to cancel in case someone is actually at the computer (like me). If no one clicks cancel it will shut down. I was going to set it to four hours so I should only see the popup once or twice. Can this be done with a BAT file? Is there a way of requesting feedback before continuing with the command? If so this would be MUCH faster than writing a small program in VB. I already have an existing shutdown timer program I made that starts up with a fixed time (like 5:00 PM) but I wanted to make the timer set to a relative time in case someone turned it back on after 5pm.

Leave a Reply

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