Schedule Automatic Shutdown in Windows 10
In this article
This guide shows you how to set up Windows 10 to shut down automatically at a specific time, whether it's every day at midnight or just once tonight. You'll use the built-in Task Scheduler, so no extra software is needed. The process takes about five minutes and works on all editions of Windows 10.
What You'll Need
- A Windows 10 PC with administrator access (you'll need to confirm a User Account Control prompt).
- The exact time you want the shutdown to happen (e.g., 23:00 for 11 PM).
- To save any open work before the shutdown runs, since Windows will close programs without warning.
Step-by-Step
- Open Task Scheduler. Press Win + R to open the Run dialog, type
taskschd.msc, and press Enter. Alternatively, search for "Task Scheduler" in the Start menu and click the top result. - Create a new task. In the right-hand "Actions" pane, click Create Basic Task…. This opens a wizard that guides you through the setup.
- Name the task. Type a descriptive name like "Scheduled Shutdown" and optionally add a description. Click Next.
- Choose the trigger. Select when you want the shutdown to happen:
- Daily – runs every day at the same time.
- Weekly – runs on specific days of the week.
- One time – runs only once, on a specific date and time.
- Set the schedule. Enter the start date and time. For a daily task, set the time and click Next. For weekly, pick the days (e.g., Monday through Friday). For one-time, pick the exact date and time.
- Choose the action. Select Start a program and click Next.
- Enter the shutdown command. In the "Program/script" field, type:
In the "Add arguments (optional)" field, type:shutdown/s /f /t 0/stells Windows to shut down./fforces running applications to close (see warning below)./t 0sets the delay to zero seconds, so it starts immediately.
- Review and finish. Check the summary screen and click Finish. The task is now created and will run at the scheduled time.
- Test it (optional but recommended). To verify the task works, right-click it in the Task Scheduler Library and select Run. Your PC will shut down immediately, so save your work first.
Common Mistakes
- Typing the time wrong. Task Scheduler uses a 24-hour clock. 7:00 PM is 19:00, not 07:00. Double-check the time format.
- Forgetting the arguments. If you only put
shutdownwithout/s /f /t 0, the task will do nothing (or open a command prompt window briefly). - Using the wrong trigger. Selecting "Daily" when you want it only once will cause it to run every day. Use "One time" for a single shutdown.
- Not saving your work. The
/fflag forces Windows to close all apps, and any unsaved work will be lost. - Creating the task under the wrong user account. If you're logged in as a standard user, the task may not run with the necessary privileges. Make sure you are logged in as an administrator.
Tips
- Add a delay instead of forcing. If you want to give yourself time to save, use
/t 60instead of/t 0. This gives a 60-second warning before shutdown. You can also add/c "Your message"to display a custom message in the warning dialog. - Create a shortcut for manual shutdown. Right-click the desktop, select New → Shortcut, and type
shutdown /s /f /t 0. This gives you a one-click shutdown button. - Cancel a scheduled shutdown. If you need to abort a pending shutdown (e.g., you started one manually), open Command Prompt and type
shutdown /a. This only works if the shutdown hasn't started yet. - Use the Task Scheduler library. All your tasks are listed there. You can right-click a task to disable, edit, or delete it.
- Set a daily shutdown for maintenance. Many users schedule a shutdown at night to clear memory and install updates automatically.
Troubleshooting
- The task runs but nothing happens. Check the arguments. Make sure you typed
/s /f /t 0correctly. A common mistake is using a capital S or leaving a space before the slash. - The task doesn't run at all. Open Task Scheduler, find your task, and check the "Status" column. If it says "Ready," it should run. If it says "Disabled," right-click and enable it. Also, verify the trigger time is correct (24-hour clock).
- Windows asks for a password when the task runs. If your PC is locked, the task may not run. In the task's properties, go to the "Conditions" tab and uncheck "Start the task only if the computer is on AC power" if you're on a laptop. Also, check "Wake the computer to run this task" if you want it to wake from sleep.
- The task runs but shuts down too early or late. Recheck the time and date in the trigger. Remember that Task Scheduler uses the local time, not UTC.
- You get an error saying access is denied. This usually means the task is set to run with different credentials. Edit the task, go to the "General" tab, and select "Run only when user is logged on." You may need to enter your password.
Frequently Asked Questions
Can I schedule a restart instead of a shutdown?
Yes. Replace /s with /r in the arguments. The rest of the setup is identical.
Will the shutdown happen even if I'm using the computer?
Yes, the task runs regardless of what you're doing. The /f flag forces all applications to close, which may cause unsaved data loss.
How do I cancel a scheduled shutdown?
Open Command Prompt and type shutdown /a. This aborts any pending shutdown that hasn't started yet. You can also delete or disable the task in Task Scheduler.
Can I set a shutdown for a specific date in the future?
Yes. Use the "One time" trigger and enter the exact date and time. The task will run once and then be marked as "Ready" but won't run again unless you re-enable it.
Does this work on Windows 11 too?
Yes, the same steps work on Windows 11, since Task Scheduler has the same interface.
What if I want to shut down after a certain amount of time, like 30 minutes from now?
You can use the shutdown command directly. Open Command Prompt and type shutdown /s /f /t 1800 (1800 seconds = 30 minutes). This doesn't require Task Scheduler.