How To Schedule An Automatic Shutdown In Windows 11 (2026)
Windows 11 has no Settings page for a shutdown timer, but the built-in shutdown command does the job in one line.
You tell it how many seconds to wait, and the PC turns itself off when the time is up.
This guide uses Microsoft’s own command reference to set a one-time timer, cancel it, and repeat it every night.
Quick answer: set a shutdown timer
| What you want | Command |
|---|---|
| Shut down in 1 hour | shutdown /s /t 3600 |
| Cancel a pending shutdown | shutdown /a |
| Shut down every night at 11 PM | schtasks /create /tn "Nightly shutdown" /tr "shutdown.exe /s /t 60" /sc daily /st 23:00 |
| Remove the nightly task | schtasks /delete /tn "Nightly shutdown" |
Shut down once after a delay
Use this when you want the PC to turn off after a download, a backup, or a movie.
- Press the Windows logo key + R to open the Run box.
- Type
shutdown /s /t 3600and press Enter. - Windows counts down 3,600 seconds, which is one hour, and then shuts down.
The /s switch tells Windows to shut down, and /t sets the time-out in seconds.
Microsoft lists the valid range for /t as 0 to 315360000 seconds (10 years), with a default of 30.
Seconds for common delays
| Delay | Value after /t |
|---|---|
| 30 minutes | 1800 |
| 1 hour | 3600 |
| 2 hours | 7200 |
| 3 hours | 10800 |
| 4 hours | 14400 |
| 8 hours | 28800 |
Multiply the minutes by 60 for any other delay.
Save your work first
Microsoft’s reference says that when the time-out is greater than 0, the /f parameter is implied.
The /f parameter forces running apps to close without warning, so unsaved data can be lost.
Save open documents before the countdown ends, or cancel the timer if you are still working.
Cancel a pending shutdown
Microsoft says to run the abort command as a separate command during the time-out period.
- Open the Run box again with the Windows logo key + R.
- Type
shutdown /aand press Enter. - The pending shutdown is aborted.
If you run it after the timer has already ended, there is nothing left to cancel.
Other useful shutdown switches
| Switch | What Microsoft says it does |
|---|---|
/s | Shuts down the computer |
/r | Restarts the computer after shutdown |
/h | Puts the local computer into hibernation, if hibernation is enabled |
/l | Signs out the current user immediately, with no time-out, and can’t be combined with other parameters |
/hybrid | Shuts down and prepares the device for fast startup; must be used with /s |
/p | Turns off the local computer with no time-out or warning; can be used only with /d or /f |
/a | Aborts a pending shutdown |
To restart on a timer instead, swap /s for /r, for example shutdown /r /t 600.
Hibernate or hybrid shutdown instead
The /h switch hibernates the PC only if hibernation is enabled, so a missing Hibernate option will make it fail.
If that option is missing, see our guide to fixing a missing Hibernate option in Windows 11.
Microsoft notes that /hybrid with /s gives the Fast Startup style of shutdown, while plain /s is a full shutdown.
Our guide to turning off Fast Startup explains that setting.
Shut down every night with Task Scheduler
A timer runs once, so a repeating shutdown needs a scheduled task.
Microsoft says only members of the Administrators group can schedule tasks, so open Command Prompt as an administrator first.
Then run this command, which uses the 24-hour HH:mm format for the start time.
schtasks /create /tn "Nightly shutdown" /tr "shutdown.exe /s /t 60" /sc daily /st 23:00
This creates a task named Nightly shutdown that runs every day at 11:00 PM and gives you 60 seconds before the PC turns off.
Because the time-out is above 0, you can still run shutdown /a within that minute to cancel a night’s shutdown.
Microsoft’s reference says schtasks does not check file paths, so a wrong path still creates a task that never runs.
To test it, run schtasks /run /tn "Nightly shutdown", which starts the task immediately and begins the 60-second countdown.
Other schedule types
| Switch | When the task runs |
|---|---|
/sc daily | Every day (or every n days with /mo) |
/sc weekly /d FRI | On the day or days you name |
/sc once /st 23:00 | One time; the start time is required, and it fails if the date and time have already passed |
/sc onidle /i 10 | When the system has been idle for the number of minutes you set |
The date format for /sd and /ed depends on your computer’s regional settings, so check it before relying on a date.
Remove or stop the nightly task
Run schtasks /delete /tn "Nightly shutdown" from an administrator Command Prompt and confirm when asked.
Microsoft says this removes the task from the schedule without deleting the program it ran.
Add /f to skip the confirmation prompt.
Never use /tn * with /f, because Microsoft warns that it deletes every scheduled task on the computer.
Timer is not the same as sleep settings
The shutdown command powers the whole PC off, while the Settings page only controls when the screen turns off and when the PC sleeps.
For that, read our guide to changing when the screen turns off in Windows 11.
To see how long the PC has run since its last start, check your PC uptime in Windows 11.