This article was co-authored by wikiHow staff writer, Hannah Dillon. Hannah Dillon is a Technology Writer and Editor at wikiHow. She graduated with a B.A. in Journalism from North Dakota State University in 2013 and has since worked in the video game industry as well as a few newspapers. From a young age Hannah has cultivated a love for writing and technology, and hopes to use these passions in tandem to help others in the articles she writes for wikiHow.
There are 7 references cited in this article, which can be found at the bottom of the page.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 1,947,106 times.
Learn more...
Do you want to schedule an automatic shutdown for your PC or Mac? It's easy to make any desktop or laptop computer turn off or restart at a particular time, either just once or on a regular schedule. This wikiHow tutorial will show you different ways to set a timer that safely shuts down your computer on Windows and macOS.
Automatically Shutting Down Your Computer
- To schedule a regular shutdown in Windows, open Task Scheduler and create a new task. You can set the task to run at the same time every day. Direct the task to run the shutdown.exe program with an additional argument of "/s".
- To schedule a regular shutdown on a Mac, open Terminal and run the command sudo pmset repeat shutdown [days] [time], replacing [days] and [time] with the days and time you want the schedule to run.
Steps
-
Open the Task Scheduler app. If you want your scheduled shutdown to occur more than once, you'll want to use Task Scheduler. Task Scheduler is available on all versions of Windows. Here's how to find it:[1]
- Windows 11 & Windows 10: Press ⊞ Win+S to open the search bar, type task scheduler, and then click Task Scheduler in the search results.
- Windows 8: Press the ⊞ Win key, type schedule tasks, and then click Schedule tasks in the results.
- Windows 7: Click the Start menu, select Control Panel, and then choose System and Security. Click Administrative Tools and then click Task Scheduler.
-
Click Create Basic Task in the "Actions" panel. It's at the top of the panel on the right side of the window. This opens the "Create a Basic Task" wizard.[2]Advertisement
-
Type Shutdown timer for the name and click Next. You can also type in a different name if you want.
-
Enter the time and date and click Next. For example, let's say that beginning on July 19, 2019, you want your PC to shut down nightly at 11:30 PM. You'd enter 7/19/2019 into the date field, and 11:30:00 PM into the time field.
- Leave the "Recur ever: X days" setting to "1" if you want the action to occur every day.
-
Select "Start a program" and click Next. This is the top option in the list.[4]
-
Type /s into the "Add arguments" field and click Next. This is what actually tells your computer to shut down. If you don't include this argument, your computer won't fully shut down.[6]
-
Review your shutdown task and click Finish. The summary screen gives you a chance to review the scheduled date(s) and time(s) for the shutdown. Once you save your task, the computer will shut down at the scheduled time.[7]
- If you need to edit or delete your task, open Task Scheduler and click the Task Scheduler Library folder in the left panel. When you find your task in the center panel, right-click it to find the option to edit Properties or Delete the task.
-
1Open Terminal. There are a few ways you can do this:
- Open Finder and go to /Applications/Utilities, then double-click Terminal.
- From the Launchpad, type "Terminal" in the search field and click on Terminal.
-
2Enter a pmset command. The pmset command controls power management settings on your Mac. You can use this command to shut your computer down at a specific time every day. Here's the command you should enter:
-
sudo pmset repeat shutdown [days] [time][8]
- If you want to shut your Mac down at the same time every day, put MTWRFSU in place of [days]. Otherwise, put just the letters for the days you want to schedule the automatic shutdown ("M" is Monday, "T" is Tuesday, "W" is Wednesday, "R" is Thursday, "F" is Friday, "S" is Saturday, and "U" is Sunday.)
- Replace [time] with the time you want your computer shut down. The time should be in 24-hour format, using HH:MM:SS. For example, if you want to shut down your computer at 10 pm every day, you'd write 22:00:00 in place of [time].
-
sudo pmset repeat shutdown [days] [time][8]
-
3Press ⏎ Return to submit the command. Your Mac will now automatically shut down following the schedule that you set.[9]
- If you want to see the currently scheduled tasks, send the command pmset -g sched in Terminal.
- To cancel the current schedule, send the command sudo pmset repeat cancel in Terminal.
-
Open a command line interface with admin privileges. Depending on your Windows version, you might see Command Prompt (Admin), Windows PowerShell (Admin), or Terminal (Admin).
- If prompted to give permission for the app to run, follow the on-screen instructions to do so.
-
Type SHUTDOWN /S /F /T number-in-seconds. Replacenumber-in-seconds with how long from now (in seconds) you want the computer to shut down.
- For example, if you want the computer to turn off in 30 minutes, you'd type SHUTDOWN /S /T 1800.[10]
- Check out this Google tool that can help you convert minutes and/or hours to seconds.
-
Press ↵ Enter. This runs the command and begins the timer. The PC will automatically shut down once the timer reaches the end.
- If you want to cancel the automatic shutdown, return to the prompt and use the command shutdown /a.
-
Open Notepad on your Windows PC. You can write a script that adds a shortcut to your desktop that, when double-clicked, schedules a shutdown. You'll find Notepad in your Windows Start menu in a folder called Windows Accessories or Accessories.
- Use this method if you don't want to schedule a recurring shutdown (e.g., nightly at 11:30 pm) but would like to quickly schedule a shutdown if necessary.
-
Enter the following code into the Notepad file. Let's say you want the script to shut your computer down at 11:30 PM on the day you run it: Type each of the following lines on its own individual line in the file:
- @echo off
- :W
- if %time%=៫:30:00.00 goto :X
- goto :W
- :X
-
shutdown.exe /s /f /t 60 /c
- This script will constantly check the time and, when 11:30 PM rolls around, will shut down the computer (after a 60-second grace period). You can replace that time with the time of your choice (in 24-hour/military time format).[11]
-
Click the File menu and select Save As. The Save As window will appear.
-
Open the Desktop folder. You can do this by expanding the This PC menu in the left panel and selecting Desktop.
-
Select All Files from the "Save as type" drop-down. It's near the bottom of the Save As window.[12]
-
Type shutdown-timer.bat into the "File name" field and click Save. Your new script is now saved to your desktop. You should see its icon (gears) on your desktop.
-
Double-click the shutdown-timer.bat file to schedule a shutdown. A blank command prompt screen should appear. You will need to leave this window open so that the computer will know to shut down at the right time. Once the time comes, you'll have 60 seconds to save your work before the computer shuts down.
- If you want to disable the script before it's time to shut down, press ⊞ Win+R to open the Run menu, type shutdown –a, and then click Run.
Community Q&A
-
QuestionDoes this work even if a game or program is running?Community AnswerYes. Anything that is running will most likely turn off without a problem.
-
QuestionDoes this work in 64-bit Win7?Community AnswerThe option is available in Windows 7 and 8. It doesn't matter whether it is a 32-bit or 64-bit system.
-
QuestionI don't understand Step 4. What is the shutdown.exe file?Tim NewmanCommunity AnswerThe shutdown.exe file is located in C:/Windows/System32/shutdown.exe. Opening this file will shut your computer down.
Video
Tips
References
- ↑ https://www.digitalcitizen.life/ways-start-task-scheduler-windows/
- ↑ https://www.tomsguide.com/how-to/how-to-use-task-scheduler-on-windows
- ↑ https://www.wintips.org/how-to-auto-shutdown-windows-10-11-schedule-automatic-shutdown/
- ↑ https://www.tomsguide.com/how-to/how-to-use-task-scheduler-on-windows
- ↑ https://www.wintips.org/how-to-auto-shutdown-windows-10-11-schedule-automatic-shutdown/
- ↑ https://www.wintips.org/how-to-auto-shutdown-windows-10-11-schedule-automatic-shutdown/
- ↑ https://www.tomsguide.com/how-to/how-to-use-task-scheduler-on-windows
- ↑ https://ss64.com/mac/pmset.html
- ↑ https://support.apple.com/guide/mac-help/schedule-your-mac-to-turn-on-or-off-mchl40376151/mac
About This Article
1. Open the Windows Task Manager.
2. Click Create Basic Task.
3. Name the task.
4. Select a frequency.
5. Select a time/date.
6. Select Start a program.
7. Enter C:\Windows\System32\shutdown.exe as the program.
8. Enter /s as the arguments.
9. Click Finish.
Reader Success Stories
-
"Spent 3/4 of an hour trying to find out how to turn my computer off automatically. I found lots of traps, "free" trials and generally didn't succeed. Clicked on this site, followed the instructions and five minutes later - done! Thank you!"..." more