How to Auto Shutdown a Laptop or PC in Windows 11

Mudin Saiful

Illustration of an alarm clock for a guide on how to auto shutdown a laptop or PC in Windows 11

Hi everyone, in this post I want to show you how to shut down a laptop or PC automatically in Windows 11. This feature is really handy, for example when you are downloading a big file before going to bed, watching a movie until you fall asleep, or want an office computer to always turn itself off at the end of the workday.

Windows 11 does not actually have a shutdown timer button in the Start menu, but we can use the built in shutdown command and Task Scheduler. In this article I tried three things directly on Windows 11: shutting down the computer with a timer, scheduling the computer to shut down at a certain time every day, and canceling an automatic shutdown when it turns out the computer is still being used.

Method 1: Auto Shutdown a Laptop or PC with a Timer

Type the shutdown command in the Run window

The shutdown -s -t 3600 command in the Run window to shut down a laptop automatically in 1 hour

Press Windows + R to open Run, then type the following command and click OK.

shutdown -s -t 3600

Here -s means shutdown and -t 3600 is the waiting time in seconds. The example above makes the computer shut down automatically in 3600 seconds, which is 1 hour. Adjust the number to whatever you need.

15 minutes = 900
30 minutes = 1800
1 hour     = 3600
2 hours    = 7200
3 hours    = 10800

Make sure the shutdown schedule is active

The message A system shutdown has already been scheduled 1190 showing the shutdown timer is active

When I tried a 1 hour timer, Windows 11 did not show any notification at all, so I was not sure whether the command had worked. The way to check is to open Command Prompt and try to create a new schedule, for example shutdown -s -t 60. If you get the message A system shutdown has already been scheduled.(1190), it means the earlier timer is indeed active.

A warning appears when only a little time is left

The You're about to be signed out window saying Windows will shut down in 2 minutes in Windows 11

If the time is short, Windows right away shows the You’re about to be signed out window along with the shutdown time. When I tried a 2 minute timer, this window appeared instantly. Click Close to close the window, and the computer will still shut down as scheduled.

Method 2: Cancel an Automatic Shutdown

Cancel it with shutdown -a

The shutdown -a command and the Logoff is cancelled notification when canceling an automatic shutdown

If it turns out you are still using the computer, open Run or Command Prompt and run the following command.

shutdown -a

A Logoff is cancelled notification will appear in the bottom right corner with the text The scheduled shutdown has been cancelled, which means the automatic shutdown has been canceled.

Warning: Close the You’re about to be signed out warning window first before typing shutdown -a. In my test, that window grabbed the keystrokes, so the word shutdown was lost and only -a reached Command Prompt, which gave the message ‘-a’ is not recognized. Luckily I still had time to type it again before the time ran out.

Method 3: Auto Shutdown the Computer at a Specific Time

If you want your laptop or PC to turn itself off at the same time every day, use Task Scheduler. This schedule keeps working even after the computer has been shut down and turned on many times.

Open Terminal (Admin)

The schtasks command in a regular Command Prompt showing ERROR Access is denied

This command has to be run as administrator. On my first try I used a regular Command Prompt, and the result was ERROR: Access is denied. So right click the Start button, choose Terminal (Admin), and then click Yes in the User Account Control window.

Create the schedule with schtasks

Creating the Shutdown Otomatis schedule for every day at 22:00 with schtasks in Terminal Admin

Run the following commands in Terminal (Admin).

schtasks /create /tn "Shutdown Otomatis" /tr "shutdown /s /f /t 60" /sc daily /st 22:00 /rl highest
schtasks /query /tn "Shutdown Otomatis"

The first command creates a task called Shutdown Otomatis that runs every day (/sc daily) at 22:00 (/st 22:00). The extra /f forces any apps that are still open to close, while /t 60 gives you 1 minute before the computer actually shuts down. The schtasks /query output shows a Next Run Time of 22:00 with the Ready status.

View the schedule in Task Scheduler

The Shutdown Otomatis task in Task Scheduler Library with the trigger At 22:00 every day

To see the schedule in the normal interface, press Windows + R, type taskschd.msc, then click Task Scheduler Library. The Shutdown Otomatis task shows up with the trigger At 22:00 every day, and at the bottom you can see that Run with highest privileges is checked. From this window you can also change the time or turn off the schedule through the Properties and Disable menus.

Test the schedule without waiting until 22:00

Testing the schedule with schtasks run brings up the warning Windows will shut down in 1 minute

To make sure the schedule works, run the task right now.

schtasks /run /tn "Shutdown Otomatis"

The You’re about to be signed out window appears right away with the text Windows will shut down in 1 minute. This means the schedule is set up correctly.

Cancel the test

Canceling the test shutdown with shutdown -a and the Logoff is cancelled notification

Click Close on the warning window, then type shutdown -a so the computer does not actually shut down. The Logoff is cancelled notification shows up again.

Delete the schedule if you no longer need it

Deleting the Shutdown Otomatis schedule with schtasks delete in Windows 11
schtasks /delete /tn "Shutdown Otomatis" /f

The schedule is deleted immediately, and schtasks /query for the same name will show ERROR: The system cannot find the file specified.

My experience: I deliberately gave the daily schedule a /t 60 delay instead of /t 0. With a 1 minute delay, if you are still working at 22:00, you still have time to close the warning and type shutdown -a before the computer shuts down.

Common Problems and How to Fix Them

ERROR: Access is denied when creating the schedule

Command Prompt or Terminal was not opened as administrator. Close the window, then open it again by right clicking Start and choosing Terminal (Admin).

A system shutdown has already been scheduled (1190)

An earlier shutdown timer is still active. Cancel it first with shutdown -a, then create the new timer.

The computer does not shut down on the Task Scheduler schedule

Usually the computer is asleep at the scheduled time, or the laptop is running on battery. Open the task Properties in Task Scheduler, then on the Conditions tab uncheck Start the task only if the computer is on AC power.

shutdown -a shows Unable to abort the system shutdown because no shutdown was in progress (1116)

There is no active shutdown schedule, so there is nothing to cancel.

That is it, your laptop or PC can now turn itself off with a timer or at a specific time, and you can cancel the schedule at any time. If you see a different error message, just leave it in the comments below.

Leave a Comment