How to Set a Timer to Shut Down a Computer

You can set a timer to shut down your computer in Microsoft Windows 8.1 by using the Task Scheduler utility or the Command Line tool. The Command Line tool enables you to shut down the computer after the specified number of seconds; the Task Scheduler utility enables you to create a recurring task that shuts down your computer daily at the specified time. If you use the Command Line, note that the default value of the shutdown command is 30 seconds and the maximum value is 315360000 seconds (10 years).

Your computer does not automatically save your work.
Image Credit: Bet_Noire/iStock/Getty Images

Using the Command Line

Step 1

Press "Windows-X" to expand the Power User menu in Windows 8.1 and then click "Command Prompt (Admin)" to launch the Command Line tool with elevated privileges. You must be logged in as an administrator to use it.

Step 2

Type "shutdown /s /t time_in_seconds" (without the quotation marks) into the Command Line tool. The /s parameter initiates the shutdown and the /t parameter tells the program the time-out period before shutdown.

Step 3

Replace the "time_in_seconds" parameter with the number of seconds and press "Enter" to execute the command. For example, to turn off the computer after two hours, you would run the "shutdown /s /t 7200" command using the Command Line tool. To shut down the PC immediately, run the "shutdown /s /t 0" command.

Using the Task Scheduler

Step 1

Press "Windows-X" to display the Power User menu and click "Control Panel" to open it. Click the "System and Security" link and then the "Administrative Tools" link. Double-click the "Task Scheduler" shortcut to launch the utility.

Step 2

Click "Create a Task" in the Actions pane to display the Create Task window. Type a name for your new task -- "Shutdown task" for example -- into the "Name" field. Click the "Run whether user is logged on or not" radio button to ensure the shutdown occurs even if the user is not logged on.

Step 3

Click the "Triggers" tab and then click the "New" button to create a new trigger. Ensure that "On a schedule" is selected from the "Begin the task" drop-down menu. Click the "One time" radio button if you don't want a recurring task; otherwise, click "Daily," "Weekly" or "Monthly." Choose the start date and time from the "Start" boxes. Check the "Enabled" box to enable the task as soon as you create it. To stop the task automatically after a specified period of time, check the "Expire" box and choose the date and time. Click "OK" to save the trigger.

Step 4

Click the "Actions" tab and then click the "New" button to create a new action. Ensure the "Start a program" option is selected from the "Action" drop-down box. Type "shutdown.exe" (without the quotes) into the "Program/script" field and then type "/s /f" (without the quotes) into the "Add arguments (optional)" field. Click "OK" to save the action.

Step 5

Click "OK" to save the task. The task appears in the Active Tasks section of the Task Scheduler Summary pane.


The "You are about to be logged off" warning message displays when you run the shutdown command in the Command Line tool. The exact time of shutdown is displayed in the warning.

The "Windows will shut down in less than a minute" warning displays one minute before the shutdown. Save your work before Windows shuts down.

You can set additional conditions for the task in the "Conditions" tab and change the settings of the task in the "Settings" tab.

To ensure the task doesn't turn off your computer while you are using it, click the "Conditions" tab, check the "Start the task only if the computer is idle for" box and then type the number of minutes into the box.

To disable or delete a task in the Task Scheduler, double-click it and then click "Disable" or "Delete" in the Actions pane.


Don't forget that you have scheduled the shutdown task; you may lose all your unsaved work when the computer shuts down.