Leaving a big game download, a backup or a video render running overnight and want the PC to switch itself off when it's done? Windows 11 has a built-in shutdown command that can do it on a timer, with no extra software. This guide follows Microsoft's official documentation for the shutdown and schtasks commands.
Step 1: Open a terminal
Open Terminal, PowerShell or Command Prompt. Microsoft notes that users must be assigned the "Shut down the system" user right to shut down a computer with the command. If you're new to the terminal, our Windows Terminal guide covers the basics.
Step 2: Set the timer
Use /s to shut down and /t to set the delay in seconds. For example, to shut down in one hour (3,600 seconds):
shutdown /s /t 3600
Some handy values: 1800 is 30 minutes, 7200 is two hours and 10800 is three hours. Microsoft says the valid range for /t is 0 to 315360000 seconds (10 years), and the default is 30 seconds if you don't set one.
Two things to know before you rely on it:
Unsaved work can be lost. Microsoft says that if the time-out is greater than 0, the /f parameter is implied, and /f forces running apps to close without warning users. Save everything you care about before the timer runs out.
Make sure the job will be finished. Windows doesn't know whether your download or render is complete, so allow plenty of time.
Step 3: Restart, hibernate or boot to the BIOS instead
The same command does more than shut down:
Command | What it does |
|---|
shutdown /r /t 3600 | Restarts the PC after one hour |
shutdown /s /hybrid /t 3600 | Shuts down and prepares the PC for fast startup (Microsoft says /hybrid must be used with /s) |
shutdown /h | Puts the PC into hibernation straight away, if hibernation is enabled |
shutdown /r /fw /t 0 | Restarts straight into the firmware (UEFI/BIOS) interface |
shutdown /r /o /t 0 | Restarts to the Advanced boot options menu |
Microsoft's documentation only mentions /f as a switch to combine with /h, so if you want a timed hibernate rather than a shutdown, a scheduled task (see Step 5) is the safer route. If you're not sure which power state you want, we explain the difference in sleep vs hibernate.
You can also add a note with /c and up to 512 characters, enclosed in double quotation marks:
shutdown /s /t 3600 /c "Shutting down after the download"
Step 4: Cancel a shutdown timer
Changed your mind? Run:
shutdown /a
Microsoft says /a aborts a pending shutdown, and it must be run during the time-out period. Once the timer runs out it's too late.
Step 5: Schedule a regular shutdown with schtasks
If you want the PC to shut down at the same time every night, create a scheduled task with schtasks. Microsoft's /sc parameter sets the schedule type (for example DAILY or ONCE), /tn names the task, /tr sets the program to run and /st sets the start time in 24-hour HH:mm format. For example, to shut down at 23:30 every day:
schtasks /create /tn "Nightly shutdown" /tr "shutdown /s /t 60" /sc daily /st 23:30
Using /t 60 gives you a minute to run shutdown /a if you're still using the PC. To remove the task later, delete it in the Task Scheduler app; our Task Scheduler guide shows how to manage tasks with the graphical tool.
If your concern is power cuts rather than routine shutdowns, see how to set up a UPS to shut down your PC automatically. And if you want the PC to wake itself up again remotely, see how to enable Wake-on-LAN in Windows 11.