Windows Guide · Power Management

How to Set a Shutdown Timer in Windows
Automatic PC Shutdown

Schedule your Windows 10 or Windows 11 computer to turn off after a delay or at a specific time using built-in tools—no third-party software required.

⊞ Windows 10 ⊞ Windows 11 ⏱ Shutdown Timer ⌨ Command Line 📅 Task Scheduler

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
💡
Quick calculation Multiply the required number of minutes by 60. For example, 45 minutes × 60 = 2,700 seconds, so the command is 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.

  1. Press Win + R to open the Run dialog.
  2. Enter a command such as shutdown /s /t 3600.
  3. Click OK or press Enter.
  4. Windows will display a notification confirming that you are about to be signed out and showing the scheduled shutdown time.
No administrator rights required A normal user can usually schedule a shutdown of the local computer. Administrator privileges are generally unnecessary for this basic command.

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.

  1. Right-click the Start button.
  2. Select Terminal, Windows Terminal, or Command Prompt, depending on your Windows version.
  3. 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
⚠️
Unsaved data may be lost Do not add /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
ℹ️
One-time timer This PowerShell method creates a one-time countdown. Use Task Scheduler when the PC must shut down automatically every day or every week.

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.

  1. Press Win + R, type taskschd.msc, and press Enter.
  2. In the right pane, click Create Basic Task.
  3. Enter a name such as Automatic PC Shutdown, then click Next.
  4. Select a trigger: One time, Daily, Weekly, or another available schedule.
  5. Set the date and time when the computer should turn off.
  6. Choose Start a program as the action.
  7. In Program/script, enter shutdown.exe.
  8. In Add arguments, enter /s /t 0.
  9. 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.

⚠️
Check open applications A scheduled task with /t 0 starts shutdown immediately. Avoid adding /f unless forced application closure is intentional.

Disable or Delete the Scheduled Shutdown Task

  1. Open Task Scheduler.
  2. Select Task Scheduler Library in the left pane.
  3. Find the shutdown task you created.
  4. 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.

  1. Right-click an empty area of the desktop.
  2. Select New → Shortcut.
  3. In the location field, enter shutdown.exe /s /t 7200.
  4. Click Next.
  5. Name the shortcut Shut Down in 2 Hours.
  6. Click Finish.

Double-clicking the shortcut starts the countdown immediately. You can create several shortcuts with different timer values.

Shortcut 01

Shut Down in 30 Minutes

shutdown.exe /s /t 1800

One click
Shortcut 02

Shut Down in 1 Hour

shutdown.exe /s /t 3600

One click
Shortcut 03

Cancel Shutdown

shutdown.exe /a

Emergency cancel

Change the Shortcut Icon

  1. Right-click the shortcut and select Properties.
  2. Open the Shortcut tab and click Change Icon.
  3. If Windows reports that the file contains no icons, click OK and select an icon from the displayed system library.
  4. 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.

Fastest method Press Win + R, enter shutdown /a, and press Enter.

Why the Cancel Command May Not Work

Frequently Asked Questions About Windows Shutdown Timers

Q Does Windows 10 or Windows 11 have a built-in shutdown timer?
Yes. Windows includes the 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?
Press Win + R, enter shutdown /s /t 7200, and press Enter. Two hours equals 7,200 seconds.
Q How can I cancel an automatic shutdown?
Run 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?
A normal countdown does not wake a sleeping computer. If the PC sleeps before the timer expires, shutdown may not occur at the intended time. For a fixed schedule, use Task Scheduler and enable Wake the computer to run this task in the task conditions when the hardware and power settings support wake timers.
Q Will Windows save my open files before shutting down?
Applications may ask you to save changes, but Windows cannot guarantee that every document will be saved automatically. The /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?
Yes. Replace /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.