
Windows does not have a simple shutdown timer in Settings, but the built-in shutdown command can power off or restart the PC after a delay. Task Scheduler can run the same command on a recurring schedule.
This applies to Windows 10 and Windows 11.
Does This Affect You?
Use a one-time shutdown for downloads, overnight tasks, or temporary limits. Use Task Scheduler if the PC should shut down at the same time every day.
Schedule a One-Time Shutdown
- Open Command Prompt. Administrator rights are not required.
- Run the command below, replacing 3600 with the delay in seconds.
- Use 1800 for 30 minutes or 7200 for two hours.
- Windows will show a shutdown warning before the timer ends.
- To cancel, run
shutdown /a.
shutdown /s /t 3600
Schedule a Daily Shutdown
- Open Task Scheduler.
- Click Create Basic Task.
- Name it, such as Nightly Shutdown.
- Choose Daily and set the time.
- Choose Start a program.
- Enter
shutdownas the program. - Enter
/s /f /t 0as the arguments. - Finish the task.
More Shutdown Command Options
Restart Instead
Use /r instead of /s to restart instead of shutting down.
Cancel a Scheduled Task
Open Task Scheduler, find the task, and choose Disable or Delete.
Add a Warning Message
Add /c "Save your work" to show a custom shutdown message when supported by the delay/time settings.
Unsaved Work
Without /f, shutdown can wait at an unsaved-work prompt. With /f, Windows forces apps closed, which can lose unsaved work.
Sources
- Microsoft Learn: Shutdown command-line reference
- Microsoft Support: Task Scheduler overview
- Microsoft Learn: Schtasks command-line reference
Disclosure: This post may contain affiliate links which means I may receive a commission for purchases made through links. I will only recommend products that I have personally used! Learn more on my Private Policy page.
