|

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 wantCommand
Shut down in 1 hourshutdown /s /t 3600
Cancel a pending shutdownshutdown /a
Shut down every night at 11 PMschtasks /create /tn "Nightly shutdown" /tr "shutdown.exe /s /t 60" /sc daily /st 23:00
Remove the nightly taskschtasks /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.

  1. Press the Windows logo key + R to open the Run box.
  2. Type shutdown /s /t 3600 and press Enter.
  3. 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

DelayValue after /t
30 minutes1800
1 hour3600
2 hours7200
3 hours10800
4 hours14400
8 hours28800

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.

  1. Open the Run box again with the Windows logo key + R.
  2. Type shutdown /a and press Enter.
  3. 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

SwitchWhat Microsoft says it does
/sShuts down the computer
/rRestarts the computer after shutdown
/hPuts the local computer into hibernation, if hibernation is enabled
/lSigns out the current user immediately, with no time-out, and can’t be combined with other parameters
/hybridShuts down and prepares the device for fast startup; must be used with /s
/pTurns off the local computer with no time-out or warning; can be used only with /d or /f
/aAborts 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

SwitchWhen the task runs
/sc dailyEvery day (or every n days with /mo)
/sc weekly /d FRIOn the day or days you name
/sc once /st 23:00One time; the start time is required, and it fails if the date and time have already passed
/sc onidle /i 10When 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.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *