One of the great things about a Windows PC is its ability to automate tasks. One such example is the automatic shutdown feature. You can schedule your Windows 11 or 10 PC to shut down automatically after a certain time, or at a certain time during the day.
This article gives different methods you can configure your Windows OS to automatically shut down, regardless of its state or processes running at that particular moment.
Table of contents
There are 2 main methods to configure your PC to turn off automatically:
- Using the Windows Command Line Interface (CLI), which includes the Command Prompt, Windows PowerShell, and the Run Command box.
- Using the Task Scheduler.
Using the CLI, you can fix the time after the computer shuts down automatically. This time is calculated in seconds from the time you execute the cmdlet.
In the case of the Task Scheduler, you can define what time the computer shuts down. This can be a one-time event, or you can pick the days when the computer shuts down automatically.
But who needs to schedule a computer to shut down automatically when the power off button is right there in the Start Menu?
Why Schedule an Automatic Shutdown
Of course, you can simply shut down the computer manually when you are done with it. However, in certain scenarios, it may be beneficial to automate this job, especially when you are not around. The following can be those scenarios:
- When a task/ process is running for which no human interaction is required. If you know the approximate time it will take for the task to complete (for example: installing software), you can schedule an automatic shutdown.
- When your system needs to run cron jobs (automated tasks) at a certain time during the day, you can configure it to shut down automatically afterward.
- If you occasionally forget to turn off your computer whilst leaving work or home, you can schedule it to power down automatically in case you missed it.
- If you want your OC to turn off at a certain time in case a child is using it. This is useful for parents wanting more control of the duration their child uses a PC.
If you find yourself in any one of these situations from time to time, continue reading this post to learn how to automate powering down your PC without any human input.
How to Automate Windows Shut Down
Using the CLI (Run Command, Command Prompt, PowerShell)
Using these 3 tools, i.e. the Run Command box, the Command Prompt, and Windows PowerShell, you can set a timer on how long after the computer will shut itself down.
We have combined the 3 tools in one section as all 3 of these are CLI tools, plus they use the same cmdlet syntax.
You can use the following cmdlet to automatically shut down the computer after a certain amount of time. The XXXX in the cmdlet denotes the time in seconds after which the computer will turn off. This timer starts as soon as the command is executed.
Shutdown -s -t XXXX
The “-s” in the cmdlet indicates that the system is shut down completely, and the “-t” switch is used to specify the delay time.
You can replace XXXX in the cmdlet with the number of seconds you want to delay the shutdown with. Here are a few examples of this cmdlet:
Shut down after 1 second:
Shutdown -s -t 1
Shut down after 1 hour:
Shutdown -s -t 3600
Shut down after 3 hours:
Shutdown -s -t 10800
Shut down after 6 hours:
Shutdown -s -t 21600
As you can see in the images below, these commands can be executed in the Command Prompt, Windows PowerShell, and the Run Command box.
After running this cmdlet in either of the CLIs, you will see a notification such as the following, giving you the details of the sign-out/ shut down.
If you change your mind about the automatic shut down before it has happened, you can cancel it at any time by running the following cmdlet in any of the CLIs:
Running this cmdlet will show a similar notification in the Notification Center as in the image below:
Using Task Scheduler
You can also tell your computer what time to shut down, instead of putting down a timer, using the Task Scheduler. Moreover, you can also repeat this automation for any number of days.
Perform the following steps to automate shutting down your PC using Task Scheduler:
Open the Task Scheduler by typing in taskschd.msc in the Run Command box.
Click Task Scheduler Library on the left, then click Create task in the right pane.
In the General tab, enter a custom name for the task, then select the “Run whether user is logged on or not” radio button. Now check the box next to “Run with highest privileges” and then select the OS you are running this task on from the drop-down menu in front of “Configure for.”
Now switch to the Triggers tab and click New.
In the New Trigger window, select “On a schedule” from the drop-down menu in front of “Begin the task.” Next, select whether you want to run the task once, daily, weekly, or monthly, and then set the date, time, and days for the task to run from the section on the right of it.
Once that is done, check the box next to “Enabled” and click Ok.
Back on the Create task window, switch to the Actions tab, and click New.
In the New Action window, select “Start a program” from the drop-down menu in front of “Action.”
Next, type in the following in the text field under “Program/Script:”
Now type in the following in the text field in front of “Add arguments (optional)” while replacing XXXX with the time delay you want to shut down the computer in. Note that the computer will automatically shut down after these many seconds after the time you have selected in step 5 above.
/s /t XXXX "PC will shutdown in XXXX seconds"
When done, click Ok.
Now back on the Create Task window, switch to the Conditions tab. Here, uncheck the box next to “Start the task only if the computer is on AC power,” and check the box next to “Wake the computer to run this task.”
Then click Ok.
You will now be asked to enter your user account credentials since the same privilege will be used to execute the task. Enter them and click Ok.
That is it! The task that you have just created will now automatically shut down the computer at the designated time of the designated day(s).
If, in the future, you want to disable this task and end the auto shut down of your Windows PC, simply return to the Task Scheduler, right-click on the task you had created, and click Delete from the context menu. If asked for a confirmation, click Yes.
For some computer geeks, the automatic shutdown feature can be a blessing. It can save their battery backup and conserve energy. In some instances, for example, running late on a weekend, you can schedule your PC to shut down automatically and take off yourself so your PC doesn’t keep running the entire weekend.
Do let us hear about your experience with the automatic shut down feature of Windows and let us know when it has come in handy for you.