> Windows
113
113 people found this article helpful
Command Prompt, Task Scheduler, and other ways to automate shutdowns one time or on a regular schedule
By
S.E. Slack
S.E. Slack
Associate General Manager, Lifewire.com
- California Polytechnic State University at San Luis Obispo
S.E. Slack has 30+ years' experience writing about technology. She has authored 12 books, thousands of articles, and worked for IBM and Microsoft.
lifewire's editorial guidelines
Updated on March 13, 2024
Reviewed by
Ryan Perian
Reviewed byRyan Perian
- Western Governors University
Ryan Perian is a certified IT specialist who holds numerous IT certifications and has 12+ years' experience working in the IT industry support and management positions.
lifewire's editorial guidelines
In This Article
Jump to a Section
Use Command Prompt
Use the Run Box
Use PowerShell
Use Task Scheduler
Frequently Asked Questions
Trending Videos
What to Know
- For one-time use: Open Command Prompt and enter shutdown -s -t 30 (or any number of seconds).
- That same command also works through the Run dialog box.
- You can use Task Scheduler to set up a detailed system for regularly scheduled shutdown events.
This article explains four ways to set a specific, automatic shutdown time for your PC. We also include information on how to stop a scheduled shutdown.
How to Schedule a Computer to Shut Down With Command Prompt
Follow these steps to use Command Prompt for a one-time shutdown.
In the Windows search box, type CMD and then press Enter to open Command Prompt.
In the Command Prompt window, type shutdown -s -t and the number of seconds you want. Here's an example:
shutdown-s-t1200
The CMD and Run command processes use seconds to measure time, not minutes. For example, if you want to shut down in 10 minutes, use 600 seconds. If you want your computer to shut off in 10 hours, use 36,000. The choice is always yours; remember to add it in seconds instead of minutes.
Press Enter to run the command.
A window will pop up, warning you Windows will shut down in the amount of time you requested.
That's it. Your computer will now automatically shut down at the time you specified. You'll receive a warning a few minutes before shutdown to remind you then, too.
How to Cancel an Automatic Shutdown in Windows 10
No longer want your computer to shut down at a specific time? To cancel an automatic shutdown triggered by a command, open Command Prompt and enter this:
shutdown-a
A message that says Logoff is cancelled confirms the command worked.
How to Set up Automatic Shutdown With the RUN Command
The same shutdown command discussed above can be triggered from the Run dialog box. Here's how to do that:
In the Windows search box, type RUN and then press Enter.
You can instead press Win + R.
In the Run dialog box, type shutdown -s -t and the number of seconds you need.
Select OK.
A window will pop up showing you that it received your request, and your computer will log off at the time you requested.
Using PowerShell for Immediate Shutdown
PowerShell is yet another way to shut down Windows 10 with a command. It works a lot like Command Prompt but with a slightly different command. Here's how to turn off your computer instantly through PowerShell:
Open PowerShell with the Power User Menu or by searching for Windows PowerShell from the search box.
Type the following command at the prompt:
Stop-Computer-ComputerNamelocalhost
Press Enter.
Make sure you've saved or closed any documents or apps as this will shut down your computer immediately.
How to Use Task Scheduler to Set up Regular Shutdowns
If you need to set a shutdown timer for multiple uses (i.e., daily or weekly automatic shutdowns), it's best to use the Task Scheduler, so you don't have to remember to set things up all the time. Follow these steps:
Open the Task Scheduler by typing Schedule into the Windows search box.
Select Enter.
Go to Action > Create Basic Task.
In the Name and Description boxes, enter a name and description of your task. Select Next.
Pick when you want the task to run, such as Daily or Monthly, and then select Next.
Enter the dates and times as needed using the prompts from the wizard. Select Next.
Choose Start a program from the list and then select Next.
Select Browse, choose shutdown.exe from the System32 folder, then select Open.
Select Next.
In the Summary window, select Finish.
With these four approaches, you can manage your computer's time and energy with ease.
FAQ
How can I set a sleep timer on my Windows 10 PC?
To set your Windows 10 sleep timer, you'll change your Windows sleep settings. In the Search box, search for sleep, and select Power & sleep settings from the results. In the Sleep section, under When plugged in, PC goes to sleep after, select the drop-down box to choose the amount of time you want your computer to remain idle before going to sleep.
How do I set a shutdown timer in Windows 8?
To set a shutdown timer in Windows 8, press Windows+X to bring up the Quick Access Menu. Select Run, enter a shutdown command in the box > OK. Or, open Task Scheduler and choose Create Basic Task, enter shutdown > Next. Then, select the start date, shutdown time, and frequency and follow the prompts.
Was this page helpful?
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe
Tell us why!