How to Automatically Shut Down a Windows PC at Night

Shutting down a Windows PC is as easy as clicking a couple of buttons. But if you have a habit of working late nights, then you might have the tendency to forget to shut down your computer after use. To avoid this, you can quickly configure your Windows computer to shut down automatically at night when it is not in use, i.e., if you are actually using the PC, the system won’t shut down. Here is how you can do so.

Configure Automatic Shutdown

To automatically shut down your Windows computer at night, we are going to use the regular “Task Scheduler.” To open the Task Scheduler, press the Start button and search for and click on the option “Task Scheduler.”


Once the “Task Scheduler” has been opened, select “Create Basic Task” from the “Actions” panel located on the right side.


The above action will open the task creation wizard. Here enter a meaningful name and description of the task you are going to create, then click on the “Next” button. That way, you can easily find the task when needed.


Here in this screen, select the radio button “Daily” and click on the “Next” button to continue.


Now enter the starting date and time. Also, make sure that you are choosing for the task to reoccur every day.


Since we are going to shut down the system, select the radio button “Start a program” and click on the “Next” button to continue.


Now enter “shutdown” in the program or script field and as the argument, enter /S. You can also enter /F as the second argument which forces your Windows computer to shut down. This is helpful when you have programs which may┬áconflict with the shutdown process.┬áMake sure that you add a space between the two arguments.


Once you are done with the configuration, just go through the summary, and if everything is fine, click on the “Finish” button. You are not yet finished, though.


Back to the main window, find the task you just created, right-click on it and select the option “Properties.”


The above action will open the task properties window. Here in the “General” section, select the checkbox “Run with highest privileges.”


Navigate to the “Conditions” tab and select all three check boxes: “Start the task only if the computer is idle for,” “Stop if the computer ceases to be idle,” and “Restart if the idle state resumes.” Also, select the time as “30 minutes” in both the fields.


Once you are done, navigate to the “Settings” tab. Here select the check boxes “Run task as soon as possible after a scheduled start is missed” and “If the task fails, start every.” Now, enter the time as “30 minutes” and the number of attempts as “3.” Also, change the time of “Stop the task if it runs longer than” to one hour.


Once you are done with settings, click on the “Ok” button to save the changes. With this, you have successfully configured the automatic shutdown at night.

If you ever need to, you can always change the settings as required from Task Scheduler’s main window.

That’s all there is to do, and it is that simple to use task scheduler to configure automatic shutdown at night when not in use.

Hopefully that helps, and do comment below to share your thoughts and experiences.

Vamsi Krishna Vamsi Krishna

Vamsi is a tech and WordPress geek who enjoys writing how-to guides and messing with his computer and software in general. When not writing for MTE, he writes for he shares tips, tricks, and lifehacks on his own blog Stugon.


  1. Thanks for this post, would you be able to share what arguments would put the computer in Hibernation or Sleep mode through a scheduled task?
    thanks in advance

    1. You can use the arguments /H along with /F to hibernate your computer on the schedule. Note that, hibernation should be enabled for this to work.

      But I don’t think there are Shutdown arguments to put your computer into sleep mode. If you want, you can create a simple bat file and schedule it to run at specific times to put your computer into sleep mode.

  2. Silly and too complicated. You can do the same thing easier in Power Settings in Control Panel.

  3. Sir,
    Can u please write an article about shortcut icon virus that creates havoc especially through pen drives? hoping for a reply

  4. I have scheduled a shut down as you have said, I now don’t want my computer to shut down at this time and have deleted the task but it still seems to keep happening, could you advise how to stop this, thanks

Comments are closed.