Set a Shutdown Timer Using Windows Task Scheduler
The most reliable way to schedule a PC shutdown is through Task Scheduler, a built-in Windows tool that runs commands at times you choose. Task Scheduler does not require third-party software and works on all Windows versions. You control exactly when the shutdown happens and can change or cancel it anytime before it runs.
Open Task Scheduler by pressing the Windows key, typing "Task Scheduler," and clicking the result. In the right panel, click "Create Basic Task." Give it a name like "Evening Shutdown" and click Next. Choose "One time" if you want it to happen once, or pick a recurring schedule (daily, weekly) if you shut down at the same time regularly. Click Next again.
Set the date and time for shutdown. If you chose "One time," enter the exact date and time. If you chose recurring, enter the time it should happen each day or week. Click Next. Under "Action," select "Start a program" and click Next. In the "Program/script" field, type shutdown and in the "Add arguments" field, type /s /t 0 (the /s means shutdown, the /t 0 means shutdown when ready with no delay). Click Finish.
Key Takeaways
- Task Scheduler is built into Windows and lets you schedule shutdown at any time without installing extra software.
- The shutdown command /s /t 0 tells your PC to power off when ready; you can add /c "Your message here" to display a warning before shutdown.
- You can set a one-time shutdown or a recurring daily or weekly shutdown through the same tool.
- To cancel a scheduled shutdown before it runs, open Task Scheduler, find your task, right-click it, and select Delete.
- If you want a countdown timer that warns you before shutdown, use the /t command followed by seconds (for example, /t 300 gives you a 5-minute warning).
Add a Warning Message Before Shutdown
By default, your PC will shut down silently at the scheduled time. If you want a warning message to appear first, you can add text to the shutdown command. In Task Scheduler, edit the task you created and change the "Add arguments" field to include a message.
Type /s /t 300 /c "Your PC will shut down in 5 minutes. Save your work." The /t 300 gives you 300 seconds (5 minutes) before shutdown happens. During those 5 minutes, a dialog box appears on your screen with your message and a countdown timer. You can click "Cancel" in that dialog to stop the shutdown if you change your mind. Replace the text in quotes with any message you want to see.
Cancel a Scheduled Shutdown
If you need to stop a shutdown that is scheduled to happen, you have two options depending on whether you set it through Task Scheduler or the command line.
If you used Task Scheduler, open it again, find the task you created in the list, right-click it, and select "Delete." Confirm the deletion. The shutdown will not happen.
If you used the shutdown command directly (see the next section), open Command Prompt or PowerShell and type shutdown /a This cancels any pending shutdown. You must run this command before the countdown timer reaches zero. If the countdown has already started and you see the warning dialog, you can also click the "Cancel" button in that dialog to stop it.
Use the Command Line for a Quick One-Time Shutdown
If you only need to schedule shutdown once and do not want to use Task Scheduler, you can type a command directly into Command Prompt or PowerShell. This method is faster for a single shutdown but does not create a permanent schedule.
Press the Windows key, type "Command Prompt," right-click the result, and select "Run as administrator." Type shutdown /s /t 300 and press Enter. This schedules your PC to shut down in 300 seconds (5 minutes). A countdown dialog appears on your screen. You can change the number 300 to any number of seconds you want. For example, /t 1800 gives you 30 minutes, and /t 3600 gives you 1 hour.
To add a custom message, type shutdown /s /t 300 /c "Message here" Replace "Message here" with whatever text you want to display. The message appears in the countdown dialog so you know why the shutdown is happening.
Schedule Shutdown on a Mac
Mac computers use a different method. Open System Preferences, click "Energy Saver," and look for the "Schedule" button. Click it and check the box next to "Start up or wake" or "Shut Down." Set the time and days you want shutdown to occur. This creates a recurring schedule that runs at the same time each day or week you select.
For a one-time shutdown on Mac, open Terminal (search for it in Spotlight), type sudo shutdown -h +300 and press Enter. Replace 300 with the number of minutes you want to wait. The system will ask for your password. Type it and press Enter. The shutdown will happen after that time passes.
Common Mistakes to Avoid
Do not forget to save your work before the scheduled shutdown time arrives. Even if you set a countdown timer with a warning message, it is straightforward to miss the notification if you are focused on something else. Set reminders on your phone or calendar for important shutdown times.
Do not use the /t 0 command if you want a warning. The /t 0 means shutdown when ready with no delay and no dialog box. If you want time to cancel or save work, always use /t followed by a number of seconds greater than zero.
Do not close the Command Prompt window after typing the shutdown command. The command runs in the background even after you close the window, but closing it when ready after typing can sometimes cause confusion about whether the command was accepted. Wait a few seconds to see the confirmation message.
Frequently Asked Questions
Can I set different shutdown times for different days of the week?
Yes, through Task Scheduler. Create separate tasks for each day, or create one task and set it to repeat weekly on specific days. In the Trigger settings, choose "Weekly" and check only the days you want shutdown to happen. Set the time once and it will repeat on those days only.
What happens to unsaved files when the PC shuts down on a timer?
Unsaved files will be lost. Windows does not automatically save open documents before a scheduled shutdown. Always save your work manually before the shutdown time arrives, or set a countdown timer long enough to give yourself time to save.
Can I restart instead of shutting down?
Yes. In Task Scheduler or Command Prompt, replace the /s command with /r. For example, shutdown /r /t 300 will restart your PC in 5 minutes instead of shutting it down. The /c and /t commands work the same way with restart.
Will the scheduled shutdown happen if my PC is in sleep mode?
No. A PC in sleep mode will not wake up to run a scheduled shutdown. The shutdown only happens if your PC is powered on and awake at the scheduled time. If you need shutdown to happen while the PC is asleep, you must use the BIOS wake timer, which is a more advanced setting specific to your motherboard.
How do I know if my shutdown task was created successfully?
In Task Scheduler, look for your task in the list under "Task Scheduler Library." Click on it and check the "History" tab at the bottom to see when it last ran and whether it completed successfully. If it shows "The task completed with an exit code of (0)," the shutdown worked as intended.