How to Schedule Auto Shutdown in Windows
In this article
This guide shows you how to make Windows shut down automatically at a specific time, either once or on a repeating schedule. You can use the built-in Task Scheduler or the shutdown command in Command Prompt. No extra software is needed, and the process works on Windows 10 and Windows 11.
What You'll Need
- A Windows PC (Windows 10 or Windows 11).
- Administrator access to your user account (needed to create scheduled tasks).
- The exact time you want the shutdown to occur, and whether it should repeat daily or just happen once.
Step-by-Step
There are two main methods: using the Task Scheduler (best for repeating schedules) or using a simple command in Command Prompt (best for a one-time shutdown).
Method 1: Using Task Scheduler (for one-time or repeating shutdowns)
- Press Windows + R to open the Run dialog box.
- Type
taskschd.mscand press Enter. This opens the Task Scheduler window. - In the right-hand pane, click Create Basic Taskā¦. This opens a wizard.
- Give the task a name, like "Auto Shutdown at 11 PM". You can add a description if you want, then click Next.
- Choose the frequency: Daily, Weekly, One time, etc. Click Next.
- Set the start date and the exact time (e.g., 23:00 for 11 PM). If you chose Weekly, also select the days. Click Next.
- Select Start a program and click Next.
- In the Program/script field, type
shutdown. In the Add arguments (optional) field, type/s /f /t 0. Click Next. - Review the summary and click Finish. The task is now created and will run at the scheduled time.
Method 2: Using Command Prompt (for a one-time shutdown)
- Press Windows + R, type
cmd, and press Enter. (You don't need to run as administrator for this.) - Type the following command and press Enter:
shutdown /s /t 3600
This schedules a shutdown after 3600 seconds (1 hour). Replace3600with the number of seconds you want. For example,7200is 2 hours,300is 5 minutes. - To cancel a scheduled shutdown, type
shutdown /aand press Enter. This works only if the shutdown hasn't started yet.
Common Mistakes
- Using the wrong time format: When using Task Scheduler, the time is in 24-hour format. So 11 PM is 23:00, not 11:00.
- Forgetting the /f flag: The
/fflag forces running applications to close without warning. Without it, Windows may wait for programs to close, which can delay the shutdown indefinitely if a program is stuck. - Typing the shutdown command wrong: The command is
shutdown, notshut downorshutdown.exe(though the latter works). Also, the slash is a forward slash/, not a backslash. - Setting the task to run with the wrong account: If you create the task under your user account and it requires your password, the task may not run if you're not logged in. For a local PC, it's usually fine, but if you want it to run even when logged off, you need to store the password or use "Run whether user is logged on or not".
- Not testing the task: It's a good idea to test with a short time (like 60 seconds) to make sure everything works before relying on it.
Tips
- Use
/t 0to shut down immediately after the command runs, but be aware that this gives you no time to cancel. A small delay (like 60 seconds) gives you a chance to abort if you change your mind. - To create a shutdown shortcut on your desktop, right-click the desktop, choose New > Shortcut, and type
shutdown /s /t 0. Name it "Shutdown" and click Finish. Double-clicking it will shut down the PC immediately. - If you want to schedule a restart instead, use
/rinstead of/sin the command or arguments. - You can also use the
shutdowncommand with a message:shutdown /s /t 600 /c "System will shut down in 10 minutes."The message appears in a notification. - If you're using a laptop, make sure it's plugged in if the shutdown time is important, as Windows may not shut down if the battery is critical and the system is in a low-power state.
Troubleshooting
If the scheduled shutdown doesn't happen, try these steps:
- Check that the task is enabled: In Task Scheduler, find your task in the Active Tasks list or under Task Scheduler Library. Right-click it and select Run to test it. If it runs, the task itself is fine; the issue is likely with the schedule or the condition settings.
- Verify the time and date: Make sure your system clock is correct. Right-click the clock in the taskbar and select Adjust date/time. If the time is off, the task will run at the wrong moment.
- Check the task's conditions: In the task's Properties, go to the Conditions tab. If "Start the task only if the computer is on AC power" is checked, and your PC is on battery, the task won't run. Uncheck that option if you want it to run regardless.
- Check the task's settings: In the Settings tab, make sure "Allow task to be run on demand" is checked. Also, "If the task fails, restart every" can help, but for shutdown it's not critical.
- If you used the command prompt method: The shutdown may have been cancelled by another program or by a Windows update that restarted the PC. You can check if a shutdown is pending by opening Command Prompt and typing
shutdown /a. If it says "A system shutdown has already been scheduled", then the shutdown is still pending. If it says "No system shutdown is in progress", then the shutdown was cancelled. - If the shutdown command itself fails: Try running
shutdown /s /t 60manually. If you get an error about access denied, you may need to run Command Prompt as administrator.
Frequently Asked Questions
Can I schedule a shutdown for a specific date and time, like next Friday?
Yes. In Task Scheduler, choose "One time" as the trigger, and then set the date and time. The task will run only once.
How do I cancel a scheduled shutdown?
If you used the command prompt method, open Command Prompt and type shutdown /a. If you used Task Scheduler, you can delete the task or disable it in the Task Scheduler library.
Will the shutdown happen if my PC is locked?
Yes, as long as the PC is on and not in sleep or hibernate mode. The task will run even if you're logged off, provided the task is configured to run whether the user is logged on or not (you may need to enter your password when creating the task).
Can I schedule a shutdown to repeat every day at the same time?
Yes. In Task Scheduler, choose "Daily" as the trigger and set the time. The task will run every day at that time.
What does the /f flag do?
The /f flag forces running applications to close without warning. Without it, Windows will try to close programs gracefully, but if a program is not responding, the shutdown may be delayed indefinitely.
Is there a way to schedule a shutdown without using Task Scheduler?
Yes, you can use the shutdown command with the /t parameter to set a delay in seconds. This is a one-time shutdown, not a repeating one. For repeating schedules, Task Scheduler is the way to go.