Quick Command to Set a Shutdown Timer in Windows 10 and Windows 11
The fastest way to turn off a Windows computer after a delay is to use the built-in shutdown command. The timer value is entered in seconds.
Shut down the computer after 1 hourshutdown /s /t 3600
In this command, /s tells Windows to shut down, while /t 3600 sets a delay of 3,600 seconds, which equals one hour.
| Delay | Seconds | Command |
|---|---|---|
| 10 minutes | 600 | shutdown /s /t 600 |
| 30 minutes | 1800 | shutdown /s /t 1800 |
| 1 hour | 3600 | shutdown /s /t 3600 |
| 2 hours | 7200 | shutdown /s /t 7200 |
| 3 hours | 10800 | shutdown /s /t 10800 |
shutdown /s /t 2700.
How to Set a Windows Shutdown Timer Using the Run Dialog
The Run dialog is the easiest method when you need a one-time timer and do not want to open a command-line window.
- Press Win + R to open the Run dialog.
- Enter a command such as
shutdown /s /t 3600. - Click OK or press Enter.
- Windows will display a notification confirming that you are about to be signed out and showing the scheduled shutdown time.
Set an Automatic Shutdown Timer with Command Prompt or Windows Terminal
You can run the same command in Command Prompt, PowerShell, or Windows Terminal. This method is useful when you want to see the command before running it or include it in a script.
- Right-click the Start button.
- Select Terminal, Windows Terminal, or Command Prompt, depending on your Windows version.
- Type the required shutdown command and press Enter.
Example — shut down after 90 minutesshutdown /s /t 5400
Add a Custom Shutdown Message
You can add a comment that explains why the computer will shut down. The message can be useful on shared PCs.
Shutdown after 30 minutes with a messageshutdown /s /t 1800 /c "The computer will shut down after the download window closes."
Should You Use the /f Parameter?
The optional /f parameter forces running applications to close. It can prevent an open program from delaying shutdown, but it may also discard unsaved work.
Force shutdown after 1 hourshutdown /s /f /t 3600
/f unless you understand the risk. Save documents and close important programs before the timer expires.
How to Shut Down Windows at a Specific Time Using PowerShell
The standard shutdown command uses a delay in seconds. To schedule shutdown for a clock time such as 11:30 PM, PowerShell can calculate the required delay automatically.
PowerShell — shut down today at 11:30 PM$target = Get-Date "23:30"
$seconds = [math]::Floor(($target - (Get-Date)).TotalSeconds)
if ($seconds -gt 0) { shutdown /s /t $seconds } else { Write-Host "The specified time has already passed." }
Change 23:30 to the required time in 24-hour format. For example, use 22:00 for 10:00 PM.
Schedule the Next Occurrence Even If the Time Has Passed
The following version schedules shutdown for tomorrow when the specified time has already passed today:
PowerShell — use today or tomorrow automatically$target = Get-Date "23:30"
if ($target -le (Get-Date)) { $target = $target.AddDays(1) }
$seconds = [math]::Floor(($target - (Get-Date)).TotalSeconds)
shutdown /s /t $seconds
How to Schedule Automatic Shutdown with Windows Task Scheduler
Task Scheduler is the best built-in option for shutting down a computer at a specific time on a recurring schedule. You can create a one-time, daily, weekly, or monthly task.
- Press Win + R, type
taskschd.msc, and press Enter. - In the right pane, click Create Basic Task.
- Enter a name such as Automatic PC Shutdown, then click Next.
- Select a trigger: One time, Daily, Weekly, or another available schedule.
- Set the date and time when the computer should turn off.
- Choose Start a program as the action.
- In Program/script, enter
shutdown.exe. - In Add arguments, enter
/s /t 0. - Review the settings and click Finish.
Program/script: shutdown.exe
Add arguments: /s /t 0
Prevent Shutdown While You Are Actively Using the PC
After creating the task, open Task Scheduler Library, double-click the task, and review the Conditions tab. Depending on your goal, you can configure the task to start only when the computer is idle, stop if the PC is no longer idle, or wake the computer to run the task.
/t 0 starts shutdown immediately. Avoid adding /f unless forced application closure is intentional.
Disable or Delete the Scheduled Shutdown Task
- Open Task Scheduler.
- Select Task Scheduler Library in the left pane.
- Find the shutdown task you created.
- Right-click it and choose Disable to keep it for later, or Delete to remove it permanently.
Create a Desktop Shortcut for a Windows Shutdown Timer
A desktop shortcut is convenient when you frequently use the same timer, such as shutting down the PC two hours after starting a long download.
- Right-click an empty area of the desktop.
- Select New → Shortcut.
- In the location field, enter
shutdown.exe /s /t 7200. - Click Next.
- Name the shortcut Shut Down in 2 Hours.
- Click Finish.
Double-clicking the shortcut starts the countdown immediately. You can create several shortcuts with different timer values.
Shut Down in 30 Minutes
shutdown.exe /s /t 1800
Shut Down in 1 Hour
shutdown.exe /s /t 3600
Cancel Shutdown
shutdown.exe /a
Change the Shortcut Icon
- Right-click the shortcut and select Properties.
- Open the Shortcut tab and click Change Icon.
- If Windows reports that the file contains no icons, click OK and select an icon from the displayed system library.
- Click OK → Apply.
How to Cancel a Scheduled Shutdown in Windows
You can cancel a pending shutdown at any time before the countdown reaches zero.
Cancel the active shutdown timershutdown /a
Run this command from the Run dialog, Command Prompt, PowerShell, or Windows Terminal. Windows should display a notification confirming that the scheduled shutdown was canceled.
shutdown /a, and press Enter.
Why the Cancel Command May Not Work
- The countdown has already reached zero and Windows has begun closing the session.
- The shutdown was started by a Task Scheduler task with no delay.
- The shutdown request came from another computer or an administrator-controlled policy.
- No shutdown is currently pending, so there is nothing to cancel.
Frequently Asked Questions About Windows Shutdown Timers
Q Does Windows 10 or Windows 11 have a built-in shutdown timer? ▼
shutdown command for one-time countdowns and Task Scheduler for shutdowns at a specific or recurring time. No additional software is required.
Q How do I shut down my computer after 2 hours? ▼
shutdown /s /t 7200, and press Enter. Two hours equals 7,200 seconds.
Q How can I cancel an automatic shutdown? ▼
shutdown /a before the timer expires. The /a parameter aborts a pending shutdown.
Q Will the shutdown timer continue if the PC goes to sleep? ▼
Q Will Windows save my open files before shutting down? ▼
/f parameter forcibly closes applications and can cause data loss, so save your work before the shutdown time.
Q Can I schedule the PC to restart instead of shutting down? ▼
/s with /r. For example, shutdown /r /t 3600 restarts the computer after one hour.
⏱ Summary
For a quick one-time timer, use shutdown /s /t seconds. To cancel it, run shutdown /a. For shutdown at a specific clock time or on a recurring schedule, use PowerShell or Task Scheduler.
Avoid the force-close parameter unless necessary, and always save important files before the timer expires.