|

How to Schedule a Shutdown in Windows 10 and 11 (CMD, Task Scheduler, PowerShell)

How to Schedule a Shutdown in Windows 10 and Windows 11

To schedule a shutdown in Windows 10 or 11, open Terminal, PowerShell, or Command Prompt as administrator and run shutdown /s /t SECONDS — replacing SECONDS with the number of seconds before the shutdown happens (for example, 14400 for four hours). To cancel a scheduled shutdown, run shutdown /a.

Applies to: Windows 10 (22H2) and Windows 11 (23H2, 24H2, 25H2) | Last updated: May 4, 2026

How to Schedule a Shutdown in Windows 10 and Windows 11

Key Takeaways

  • The fastest method is the shutdown command — works identically on Windows 10 (22H2) and Windows 11 (23H2, 24H2, 25H2)
  • The timer is set in seconds — one hour is 3600 seconds, four hours is 14,400 seconds, and the maximum is 315,360,000 seconds (10 years)
  • Use shutdown /a to cancel a scheduled shutdown before it triggers
  • Task Scheduler is the GUI option for recurring shutdowns (every night at 11pm, for example) — no command line needed
  • PowerShell has its own Stop-Computer cmdlet, but it cannot delay a shutdown — you have to combine it with Start-Sleep to add a timer

Quick Steps:

  1. Right-click the Start button and open Terminal (Admin) on Windows 11, or Command Prompt (Admin) on Windows 10
  2. Convert the time you want into seconds (1 hour = 3600, 2 hours = 7200, 4 hours = 14,400)
  3. Run shutdown /s /t SECONDS — for example, shutdown /s /t 14400 for a 4-hour timer
  4. Windows displays a notification confirming when the shutdown will happen
  5. To cancel before it triggers, run shutdown /a

In This Guide


Method 1: Schedule a Shutdown with the Shutdown Command

The shutdown command is the quickest way to schedule a one-time shutdown on Windows 10 or 11. It is built into the operating system, requires no extra setup, and works identically in Command Prompt, PowerShell, and Windows Terminal.

Step 1: Open Terminal as Administrator

Right-click the Start button and select Terminal (Admin) on Windows 11, or Command Prompt (Admin) / Windows PowerShell (Admin) on Windows 10. Approve the User Account Control prompt when it appears.

Step 2: Run the Shutdown Command

Type the following command, replacing SECONDS with how many seconds you want before the shutdown:

shutdown /s /t SECONDS

For example, to shut down in 4 hours, four hours equals 14,400 seconds:

shutdown /s /t 14400

To force any open applications to close (useful if you are leaving the computer unattended and don’t want unsaved-document prompts to block the shutdown), add the /f flag:

shutdown /s /f /t 14400

Tip: If you don’t want to do the math yourself, run an “hours to seconds” conversion in Google. Type “4 hours to seconds” and Google returns 14,400 instantly.

Step 3: Confirm the Notification

Once you press Enter, Windows displays a toast notification in the bottom-right corner confirming the exact time the shutdown will happen. As the shutdown approaches, you will also see a sign-out warning a few minutes before it triggers.

Method 2: Schedule a Recurring Shutdown with Task Scheduler

If you want your computer to shut down at the same time every day (or every weekday, every Sunday at 11pm, etc.), Task Scheduler is the right tool. It is the only built-in option that handles recurring shutdowns through a graphical interface.

  1. Press the Windows key, type Task Scheduler, and open it
  2. In the right pane, click Create Basic Task
  3. Give it a name like Nightly Shutdown and click Next
  4. Choose a trigger — Daily, Weekly, One time — and the time you want the shutdown to happen
  5. Choose Start a program as the action
  6. In Program/script, enter shutdown
  7. In Add arguments, enter /s /f /t 0 (the /t 0 means shut down immediately when the task runs)
  8. Click Finish

The task will now trigger at the time you set, and the shutdown command runs through Windows just like if you typed it in Terminal. To delete or modify the schedule later, open Task Scheduler, go to Task Scheduler Library, and find your task in the list.

Method 3: Schedule a Shutdown with PowerShell

PowerShell has a native cmdlet called Stop-Computer that shuts the system down, but unlike shutdown.exe, it does not have a built-in delay parameter. To schedule a shutdown with it, you combine it with Start-Sleep.

Open PowerShell as administrator and run a one-liner like this — the example sleeps for 4 hours (14,400 seconds), then forces a shutdown:

Start-Sleep -Seconds 14400; Stop-Computer -Force

The catch is that the PowerShell window has to stay open for the timer to keep running. Closing the window cancels the wait. For a fire-and-forget timer, the shutdown command from Method 1 is the better choice because it registers with the Windows session and runs even if you close every Terminal window afterward.

Note: Stop-Computer is most useful in PowerShell scripts that already need to do other work before shutting down — for example, finishing a backup and then powering off. For a simple “shut down in 4 hours” command, stick with shutdown /s /t SECONDS.

How to Cancel a Scheduled Shutdown

Changed your mind? Open Terminal, PowerShell, or Command Prompt (admin not strictly required to cancel, but recommended) and run:

shutdown /a

The /a flag aborts a system shutdown, but it only works during the timeout period. Once the shutdown actually starts, you can no longer cancel it. Windows will display a brief notification confirming the shutdown was aborted.

Shutdown Command Flags Explained

The shutdown command supports both forward-slash and dash-prefixed flags (/s or -s) — they do the same thing. Here are the ones you will actually use:

  • /s — Shut down the computer
  • /r — Restart instead of shut down
  • /f — Force running applications to close without warning the user
  • /t SECONDS — Set the timer in seconds (max 315,360,000)
  • /a — Abort a scheduled shutdown
  • /h — Hibernate the computer (no timer support)
  • /l — Log off the current user

To schedule a restart instead of a shutdown, swap /s for /r — for example, shutdown /r /f /t 14400 restarts the computer in 4 hours.

If you would like more control over Windows behavior in general — startup apps, taskbar tweaks, telemetry, and similar settings — check out my own free open-source tool, Winhance, the Windows Enhancement Utility. It collects most of the customization options Windows hides into one app.


Frequently Asked Questions

How do I cancel a scheduled shutdown in Windows?

Open Terminal, PowerShell, or Command Prompt and run shutdown /a. This aborts any pending shutdown that has not yet started. The command works on Windows 10 and 11. Once the shutdown sequence has actually begun (after the timer hits zero), it can no longer be cancelled.

Can I schedule a restart instead of a full shutdown?

Yes. Replace the /s flag with /r in the command. For example, shutdown /r /f /t 3600 restarts the computer in one hour and forces any running applications to close. Everything else about the command behaves the same.

What is the maximum time I can schedule a shutdown for?

The maximum value for the /t flag is 315,360,000 seconds, which is exactly 10 years. For practical use, you will rarely need more than a few hours. If you need recurring shutdowns instead of a single long delay, use Task Scheduler instead.

Will the /f flag close my running programs without warning?

Yes. The /f flag forces all running applications to close immediately when the shutdown triggers, without giving them a chance to prompt you to save unsaved work. Save your documents before the timer expires, or skip the /f flag if you want to be prompted.

Do I need administrator privileges to schedule a shutdown?

You need administrator privileges to schedule a shutdown that affects the whole system. Running Terminal, Command Prompt, or PowerShell with “Run as administrator” is the standard approach. To cancel a scheduled shutdown with shutdown /a, an admin window is recommended but not always required, depending on how the shutdown was originally scheduled.

Similar Posts