Windows 11 (or 10) doesn’t include an option to schedule an automatic shutdown of your computer, but it’s possible to use different tools to complete this task without having to resort to third-party applications.
If you must turn off the computer after a specific time, you have at least seven ways. You can use commands with PowerShell, Command Prompt, and the Run dialog. It’s also possible to trigger a shutdown using a shortcut or a batch file.
You can even use the Settings app, and while the power settings allow you to set a sleep mode timer, it’s also an option to save energy and extend battery life.
Finally, you can also create a task with the Task Scheduler to run a specific command that will shut down the computer at a specified time.
In this how-to guide, I will explain the different methods to schedule an automatic shutdown of your computer running Windows 11 (or 10).
How to shut down your computer on schedule
On Windows 11, you have at least seven different methods to shut down your computer at a specific time, and here’s how.
1. From Command Prompt
The easiest way to schedule an automatic shutdown is using the “Shutdown” command-line tool.
To shutdown your computer using Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Quick note: The “Shutdown” command may also work without elevation, but it depends on the options you use.
- Type the following command to schedule a complete shutdown of the computer and press Enter: shutdown /s /f /t SECONDS
In the command, change “SECONDS” for the number of seconds to schedule a shutdown. For example, this command powers off the device after two hours: shutdown /s /f /t 7200
- (Optional) Type the following command to cancel the command and press Enter: shutdown /a
Once you complete the steps, the computer will power off at the specific time you specify in the command.
Command breakdown:
- /s – Instructs the command you want to shut down.
- /t – Specifies the schedule in seconds (for example, “/t 60”).
- /f – Forces to close a running application to complete processing the command.
- /a – Aborts the shutdown, but it can only be used during the time-out period.
2. From PowerShell
PowerShell doesn’t actually offer a command to schedule an automatic shutdown. However, we can use the “Start-Sleep” command that allows you to put the system into sleep mode, and then we follow up with the “Stop-Computer” command that will shut down the computer immediately after the sleep mode is triggered.
To shutdown the computer automatically using a PowerShell command, use these steps:
- Open Start.
- Search for PowerShell, right-click the top result, and select the Run as administrator option.
- Type the following command to schedule a complete shutdown of the computer and press Enter: Start-Sleep -Seconds SECONDS; Stop-Computer
- In the command, change “SECONDS” for the time the system should wait before shutting down. For example, this command powers off the device after two hours: Start-Sleep -Seconds 7200; Stop-Computer
After you complete the steps, the device will shut down automatically at the time you specified in the command.
3. From Run dialog
If you don’t want to open a command line console, you can use the “Run” dialog interface to execute the shutdown command.
To schedule an automatic shutdown using the Run dialog, use these steps:
- Open Start.
- Search for Run and click the top result to open the app.
- Quick tip: You can also use the “Windows key + R” keyboard shortcut or right-click the Start button and choose the “Run” option.
- Type the following command to power off a device at a specific time and press Enter: shutdown /s /f /t SECONDS
In the command, change “SECONDS” for the number of seconds to schedule a shutdown. For example, this command powers off the device after two hours: shutdown /s /f /t 7200
- (Optional) Type the following command to cancel the command and press Enter: shutdown /a
The Task Manager doesn’t provide an option to turn off your computer on schedule, but you can
It’s also possible to access the “Run” command from the Task Manager and then run the “Shutdown” command, as noted in the above steps.
4. From Shortcut
Alternatively, you can also create a shortcut that you can run to schedule a power-down of the system at a specific time.
To create a shortcut to power off a computer automatically at a specific time, use these steps:
- Right-click on the desktop.
- Choose the Shortcut option in the New menu.
- Type the following command to shutdown a computer on schedule and press Enter: shutdown /s /t SECONDS /f
In the command, change “SECONDS” for the number of seconds to schedule a shutdown. For example, this command powers off the device after two hours: shutdown /s /f /t 7200
- Click the Next button.
- Confirm a name for the shortcut.
- Click the Finish button.
Once you complete the steps, you can simply double-click the shortcut, and the computer will schedule a shutdown for the time you specified.
The only caveat with this method is that you will have to modify the timer in the shortcut’s properties to change the time.
5. From batch file
Instead of a shortcut, you can also create a batch file that you can run to configure the system to shut down at a specific time.
To create a batch file to shutdown your computer automatically, use these steps:
- Open Start.
- Search for Notepad and click the top result to open the app.
- Type the following command to shut down a computer automatically and press Enter: shutdown /s /f /t SECONDS
In the command, change “SECONDS” for the number of seconds to schedule a shutdown. For example, this command powers off the device after two hours: shutdown /s /f /t 7200
- Click the File menu and choose the Save as option.
- Select the folder location.
- Confirm the name with the “.bat” file extension. For example, shutdown.bat.
- Click the Save button.
After you complete the steps, you can double-click to run the script and configure the computer to shutdown automatically.
6. From sleep settings
Although the power settings don’t include an option to turn off a device, you can use the timeout settings to put the computer to a low-power state, which can be helpful if you’re looking to conserve energy and extend battery life.
To schedule a computer power-down after some time of inactivity, use these steps:
- Open Settings.
- Click on System.
- Click the Power & Battery page from the left side.
- Click the “Screen and sleep” (or “Screen, sleep, & hibernate timeouts”) setting under the “Power” section.
- Choose how long the device must wait before going into sleep mode.
Once you complete the steps, the computer will go into the sleep mode of inactivity you specified in the settings.
The above instructions only apply to Windows 11 if you want to change the timeout settings on Windows 10, open Settings > Power & sleep and change the Sleep setting.
7. From Task Scheduler
You can also use the Task Scheduler to create a task that will run the “Shutdown” command on a schedule to turn off the computer.
To schedule an automatic shutdown with the Task Scheduler, use these steps:
- Open Start.
- Search for Task Scheduler and click the top result to open the app.
- Right-click on the Task Scheduler Library folder and choose the New Folder option.
- Confirm the MyTasks name (or any other descriptive name) and press Enter.
- Right-click the newly created folder and choose the “Create Basic Task” option.
- Confirm the “Auto Shutdown PC” name.
- Click the Next button.
- Select the recurrence of the task.
- Quick note: Choose the recurrence that meets your requirements. I’ll choose the “One Time” option.
- Click the Next button.
- Set the time when you want to the system to power off the computer.
- Click the Next button.
- Choose the “Start a program” option.
- Click the Next button.
- Confirm the following path to the Shutdown tool in the “Program/script” text field: C:\Windows\System32\shutdown.exe
- Confirm the following switches in the add arguments text field: /s /f /t 0
- Click the Next button.
- Click the Finish button.
After you complete the steps, the Task Scheduler will run the task at the specified time, triggering the command to shut down your computer.
More resources
Find in-depth guides, troubleshooting tips, and the latest updates on Windows 11 and 10 here: