To automatically turn off your computer at night, you can use a scheduled task. You can shut down your computer every night at a specific time, 11:00 for example. The problem is that if one night you want to work later than usual, your computer will still get turned off, even if you are on.
The solution? Condition the start of the scheduled task to inactivity on your computer. Thus, from the chosen time, 11:00 in our example, the scheduled task will check if you are currently using your computer, trying to download something, for example. If this happens, the computer will not get turned off. Hence, when there will be more than 30 minutes without activity on your computer, it will be stopped. Below are the step by step process for the same:
- Create the scheduled task: Click Start and then Control Panel.
- Click System and Security.
- In the Administrative Tools section, click Scheduled Tasks.
- In the right pane of Task Scheduler, click Create Task.
- Enter a name for the task, turn off the PC at night for example.
- Check the box Run with highest privileges.
- Then open the Triggers tab.
- Click the New button.
- Then select the frequency of the task (every day) and time of the shutdown, 23:00 here.
- Click OK and open the Actions tab.
- Click the New button.
- Enter the shutdown command in the field Program / ??script.
- Enter the / S parameter in the Add arguments and click OK.
Perform the task when idle:
The interest of the manipulation is to stop your computer to the schedule set, only if you’re not using it. You must configure the task to run only when inactivity. Here is how to do that:
- Open the Conditions tab.
- Check the box Start the task if the computer is inactive for: and specify the idle time to wait 30 minutes for example. By default, the inactivity is expected for 1 hour. Increase this value if you wish.
- Check the boxes Stop if the computer is not idle and restart if the idle state again. Thus, the computer will not be turned off if you’re using. The task will resume as soon as you disconnect your computer. After 30 minutes of inactivity, he will be arrested.
- Then open the Settings tab.
- Check the box if the task fails, restart every 30 minutes and choose.. This way, if you stay up late on your computer, it will still be turned off automatically when not in use anymore.
- Scroll down Stop the task if it runs over and select one hour. Finally, click OK.
- Close the Task Scheduler. Now, at 23:00, your computer will automatically shut down if it’s been over 30 minutes it was not used. If you use your computer, it will not be stopped. Therefore, as soon as 30 minutes of inactivity are detected, it will be stopped, unless of course you stop it manually before.