Creating an auto shutdown task in Windows Task Scheduler is a straightforward process that allows your computer to shut down automatically at a specific time or event.
Here's how to set it up using Task Scheduler:
You can schedule your computer to shut down automatically by creating a simple task in the Windows Task Scheduler utility. This is useful for unattended operations, saving power, or ensuring updates complete overnight.
The core idea is to create a task that runs the shutdown
command with the appropriate arguments at a specified time.
Steps to Schedule an Automatic Shutdown
Based on information similar to that found on sources like C# Corner, follow these steps:
-
Open Task Scheduler:
- Click on the Start button.
- Search for "Task Scheduler" in the search bar.
- Press Enter or click on the "Task Scheduler" application to open it.
-
Create a Basic Task:
- In the Task Scheduler window, look for the "Actions" pane on the right side.
- Click on the "Create Basic Task" option. This wizard simplifies the process.
-
Name Your Task:
- Provide a Task Name that is easy to identify, such as "Auto Shutdown", "Daily Shutdown", or simply "Shutdown".
- You can also add a brief description if needed.
- Click Next.
-
Choose When the Task Starts:
- Select the Trigger for your task. This determines when the shutdown will occur. Common options include:
- Daily: To shut down at the same time every day.
- Weekly: To shut down on specific days of the week.
- One time: To shut down only once at a specific date and time.
- When the computer starts: To shut down shortly after startup (less common for simple auto-shutdown).
- Select your preferred option and click Next.
- Select the Trigger for your task. This determines when the shutdown will occur. Common options include:
-
Configure the Trigger Details:
- Based on the trigger you chose (e.g., Daily, One time), specify the exact date and time you want the task to run.
- Click Next.
-
Choose the Action:
- Select "Start a program" as the action you want the task to perform.
- Click Next.
-
Configure the Program to Start:
- This is where you specify the shutdown command.
- In the "Program/script:" field, type:
shutdown.exe
- In the "Add arguments (optional):" field, specify the command-line arguments. For a standard shutdown, you typically use:
/s
: Shuts down the computer./t XXX
: Specifies the time in seconds before shutting down. ReplaceXXX
with the desired delay (e.g.,/t 60
for a 1-minute delay). Adding a delay gives you time to save work if the shutdown occurs unexpectedly./f
: Forces running applications to close without warning users. Use with caution, as unsaved work will be lost./c "Message"
: Adds a custom message to the shutdown warning (e.g.,/c "Computer is shutting down in 1 minute"
).
- A common argument combination is
/s /t 60
to shut down in 60 seconds. - Click Next.
-
Finish and Review:
- Review the details of the task you have configured.
- Ensure the trigger and action are correct.
- Click Finish to create and activate the scheduled shutdown task.
Common Shutdown Arguments Table
Argument | Description | Example |
---|---|---|
/s |
Shuts down the local computer. | /s |
/t XXX |
Sets the time-out period before shutdown in seconds. | /t 120 |
/f |
Forces running applications to close. | /f |
/r |
Restarts the computer. | /r |
/a |
Aborts a pending system shutdown. | /a |
/c "Msg" |
Adds a custom message. | /c "Bye!" |
To remove a scheduled shutdown, open Task Scheduler, find your task name under "Task Scheduler Library," right-click it, and select "Delete."
This process allows you to reliably schedule an automatic shutdown for your Windows computer using built-in tools.