Do you want to turn off your computer at night but do you sometimes forget to shut it down yourself? With the help of Task Scheduler you can turn off your PC automatically.
Step 1: New task
In principle, you can also have the computer automatically shut down after a certain period of inactivity via Power Management. However, the method via a Task Scheduler script that we explain here has the advantage that you can set a specific time. Open this tool by typing "task scheduler" in the search box of the start menu. You will notice that there are already tasks in this tool. After all, other applications follow the same path to automatically search for updates at set times. In the right column are the Actions. Click on the action Create task. Give the new task a name, for example 'Close at midnight' and check the option Run regardless of whether the user is logged in or not at. At the very bottom at Configure for you select Windows 10.
Step 2: Trigger
Then click on the tab Triggers and use the button New. In this window you make sure that at Start this task in the option Planned stands. Then you have to indicate on which days the PC should perform this task: One-off, Daily, Weekly or Monthly. Finch Daily at. This option opens a selection window where you must indicate the time at which this action should take place. In our example, that's midnight. click on OK to save these settings.
Step 3: Action
This new trigger appears with the tasks. Select this task and open the tab Actions. click on New. In the box Action do you need the option Start program Selecting. Fill in the box Program/script the assignment shutdown in. In the box Add parameters take note /s/f. click on OK to close this window. To make sure the script doesn't turn off the computer when you're still working at midnight, select the task and open the tab Conditions. Here you specify as a condition that the device must be inactive for half an hour, and that it must wait an hour before checking the computer's activity again. Finally, there is the tab Institutions. Here you determine what should happen if the task fails. Tick the option If the task fails, reboot every and enter the number of minutes after which this action may be attempted again.