Settings
Schedule a Shutdown in Windows 11: Timer and Daily Task
Written by Windows 11 Field Guide Editorial Team · Updated

You can schedule a shutdown in Windows 11 without installing anything: a single built-in command starts a countdown, and Task Scheduler can turn the PC off at the same time every night. It is useful when a long download or render should finish before the PC turns off, when children’s or shared PCs should not run all night, or when you simply forget to shut down.
This guide covers the one-off timer, how to cancel it, how to make it daily, restart and hibernate variations, and one important catch Microsoft documents about unsaved work. The steps apply to Windows 11 version 24H2 and 25H2, Home and Pro.
Before you start: the unsaved-work catch
The shutdown command has a /f option that forces running apps to close without warning, and Microsoft’s documentation warns that this can lose unsaved data. The catch is that any delay greater than zero implies /f. So a timed shutdown will not stop to ask whether you want to save a document; it closes the app. Save everything that matters before the timer runs out, or use a short final warning (described below) so you have a chance to react.
Set a one-off shutdown timer
- Press Windows key + R to open Run.
- Type the command with your delay in seconds:
shutdown /s /t 3600
- Press Enter. Windows shows a notice that it will shut down, and the countdown starts.
Common delays:
| Delay | Seconds |
|---|---|
| 10 minutes | 600 |
| 30 minutes | 1800 |
| 1 hour | 3600 |
| 2 hours | 7200 |
| 4 hours | 14400 |
The /t value can be anywhere from 0 up to a very large number (Microsoft lists up to ten years), with a default of 30 seconds if you leave /t out. You can type the same command in Terminal or Command Prompt instead of Run.
Cancel a scheduled shutdown
Changed your mind? Open Run again (Windows key + R) or a new Terminal window and type:
shutdown /a
Microsoft notes that this has to be run as a separate command during the timeout period. Once the countdown has ended, it is too late.
Shut down at a specific time today
The command counts seconds, not clock times, so a little arithmetic is needed. To shut down at 23:00 when it is now 21:15, the gap is 1 hour 45 minutes: 105 minutes times 60 is 6,300 seconds, so you would run shutdown /s /t 6300. If you need an exact clock time every day, Task Scheduler (below) is easier because you enter the time directly.
Add a message for other users
On a shared PC it helps to say why the computer is about to turn off. The /c option adds a comment in double quotation marks, up to 512 characters, which appears in the shutdown notice:
shutdown /s /t 900 /c "Shutting down in 15 minutes. Save your work."
Anyone who sees the notice can still cancel with shutdown /a if they need more time, so tell them that too.
Restart, hibernate or sign out instead
The same tool has other modes:
shutdown /r /t 600restarts the PC in ten minutes.shutdown /hhibernates the PC straight away, if hibernation is enabled. Our guide to enabling hibernate in Windows 11 explains how to turn it on.shutdown /lsigns out the current user immediately.shutdown /r /orestarts into the advanced startup options, the same menu used for Safe Mode and recovery tools, covered in our Safe Mode guide.
If you want the PC to sleep after a period of inactivity rather than at a set time, that is a power setting instead: see how to change the screen timeout and sleep settings.
Shut down every night with Task Scheduler
For a daily routine, let Task Scheduler run the command for you.
- Search Start for Task Scheduler and open it.
- In the right pane select Create Basic Task.
- Give it a name such as “Nightly shutdown” and select Next.
- Choose Daily, then set the start date and time, for example 23:30.
- Choose Start a program.
- In Program/script type
shutdown. - In Add arguments type
/s /t 60. The 60-second delay gives anyone still at the PC a warning and a chance to run shutdown /a. - Finish the wizard.
To test it, right-click the task in the Task Scheduler Library and choose Run, then cancel with shutdown /a. To stop the routine, right-click the task and choose Disable or Delete.
A task set this way only runs while the PC is on and you are signed in, which is what most people want. The task’s Properties window has options for running whether or not a user is signed in; those need the account password and are more useful on shared PCs.
If you prefer the command line, Microsoft’s schtasks reference shows how to create the same daily task with a single command; the wizard is easier for a one-time setup.
Scheduled shutdown and Windows Update
A nightly shutdown can collide with updates. If an update is waiting, the shutdown option may install it as part of shutting down, which takes longer but is normal. Do not cut the power while Windows says it is working on updates. If updates keep restarting the PC at awkward times, set active hours in Windows Update settings, or pause Windows 11 updates for a short period.
Also note that a nightly shutdown does not fully reset Windows when fast startup is on, because shutting down then saves part of the system state. If you are shutting down to clear a problem, use a restart, or see our guide to turning off fast startup.
Troubleshooting
- “Access is denied”. Your account needs the right to shut down the system; on a work PC this may be restricted by policy.
- Nothing happens. Check for a typo: the switches use a forward slash and a space between each one.
- The task did not run. Open the task’s History tab in Task Scheduler and check that the PC was on and you were signed in at that time.
- Apps lost unsaved changes. That is the /f behaviour described above; save before the timer ends.
- The PC turns itself off at times you did not set. Look for an old task in Task Scheduler, check power settings, and if it is a sudden power-off rather than a normal shutdown, see our guide to random shutdowns in Windows 11.
Related everyday controls are collected in the Windows 11 settings hub.
Frequently asked questions
How do I set a shutdown timer in Windows 11?
Press Windows key + R, type shutdown /s /t 3600 and press Enter. Replace 3600 with the number of seconds you want; Windows shuts down when the countdown ends.
How do I cancel a scheduled shutdown?
Open Run or a new Terminal window and run shutdown /a before the timer ends. It only works during the countdown.
Will a scheduled shutdown save my work?
No. Microsoft documents that a timeout greater than zero implies the /f option, which forces apps to close, so anything unsaved can be lost. Save your work before the timer runs out.
How do I shut down my PC automatically every night?
Create a basic task in Task Scheduler with a daily trigger at the time you want, and set the action to start the program shutdown with the arguments /s /t 60, which gives a one-minute warning.
Can I schedule a restart instead?
Yes. Use /r instead of /s, for example shutdown /r /t 600 restarts the PC in ten minutes. For Windows Update restarts, use the active hours and restart options in Windows Update settings instead.
Sources
Windows 11 Field Guide Editorial Team
Editorial team
The Windows 11 Field Guide team writes and updates independent Windows 11 guides and checks each step against Microsoft's documentation and the current Settings app.





