Imagine you are downloading a massive 100GB video game, exporting a high-resolution 4K video project, or running a complex data analysis script that will take hours to complete. You need to leave for work or go to sleep, but you do not want to leave your PC running at full power all night long after the task finally finishes.
Windows 11 includes a built-in, command-line tool that allows you to automate the shutdown process. By passing a specific timer argument to the native shutdown executable, you can tell your PC to gracefully power itself off after a specific number of seconds have elapsed.
This guide explains how to schedule a delayed shutdown using the Command Prompt or PowerShell in Windows 11.
Step 1: Calculate the Time in Seconds
The shutdown command requires you to input the delay timer in seconds, not minutes or hours. Before you open the terminal, you must calculate exactly how long you want to wait.
- 1 Hour = 3600 seconds
- 2 Hours = 7200 seconds
- 3 Hours = 10800 seconds
- 4 Hours = 14400 seconds
If you want the PC to shut down in exactly two and a half hours, you would calculate (2.5 * 60 * 60) = 9000 seconds.
Step 2: Execute the Shutdown Command
Once you have your number, you can issue the command using the standard Windows Run dialog, the Command Prompt, or PowerShell.
- Press the Windows Key + R on your keyboard simultaneously to open the Run dialog box.
- Type the following command, replacing
[SECONDS]with your calculated number:
For example, to shut down the computer in exactly two hours (7200 seconds), you would type:shutdown -s -t [SECONDS]shutdown -s -t 7200 - Click OK or press Enter.
Immediately after you hit Enter, Windows 11 will display a notification banner in the bottom right corner of your screen stating, “You’re about to be signed out. Windows will shut down in X minutes.” The timer is now running silently in the background, and you can safely walk away from your PC.
How to Cancel a Scheduled Shutdown
If your download finishes much faster than anticipated or you simply change your mind and decide to keep using your computer, you can easily abort the scheduled shutdown timer.
- Press the Windows Key + R to open the Run dialog box again.
- Type the following command:
shutdown -a - Press Enter.
The -a flag stands for “abort.” Windows will display a new notification confirming that the scheduled logoff has been canceled. Your PC will remain on until you manually shut it down.