How to Schedule Shutdown on Windows 11 & 10: CMD and Task Scheduler

In this tutorial, I will show you how to schedule a shutdown on Windows using both Command Prompt and Task Scheduler.

This guide works on any Windows operating system, including Windows 10, Windows 11, and Windows Server.

Timed Shutdown Using CMD

The quickest and easiest way to schedule a one-time shutdown is by using the shutdown command.

Open Command Prompt or PowerShell and type shutdown /s /f, then use /t to specify the time delay in seconds. For example, 300 seconds means the computer will shut down in 5 minutes.

shutdown /s /f /t 300
  • Use /r instead of /s to reboot the computer.
  • Click this link to learn more about the shutdown command.

If you change your mind and don't want to shut down the computer, run shutdown /a before the scheduled time.

shutdown /a

Schedule Shutdown Using Task Scheduler

Command Prompt is good for basic, one-time shutdowns. For more advanced scheduling options, such as recurring shutdowns or those based on specific conditions, we need to use Task Scheduler.

To schedule a shutdown, open Task Scheduler, go to the 'Action' menu, and choose 'Create Basic Task.'

Create Basic Task
Create Basic Task

First, give it a name, then choose whether you want to run it one time or as a recurring task. Here, I will choose one time.

timed shutdown windows
Timed Shutdown

Next, select the time for the computer to shut down.

Shutdown time
Shutdown time

For the action, choose 'Start a program.'

Create Schedule Shutdown Using Task Scheduler

Next, in the 'Program/script' field, type shutdown, and in the 'Arguments' field, type /p /f, as shown in the following screenshot.

shutdown pc using task scheduler

Then, move to the next window and click 'Finish' to save and add the task to the Windows Scheduler.

After creating the task, go to the Task Scheduler Library and double-click the task you created. This will open the Properties window, where you can modify the task. You may want to adjust some of the options.

In the General tab, under the Security options, it will show which user account is used to run the scheduled shutdown. The important thing is that the task will not run if the user is not logged in. If you want the task to run even when the user is not logged in, select the radio button 'Run whether user is logged on or not.'

shutdown when user is now logged on

The Conditions tab includes power options. By default, the task will not run while on battery power. Also, If you want to run the scheduled shutdown when the computer is in sleep mode, activate the 'Wake the computer to run this task' checkbox.'

run the scheduled shutdown when the computer is in sleep mode

If you want to edit the task, the Triggers tab allows you to change the shutdown time. The Actions tab is where you can modify the parameters for the shutdown command.