This task is very useful when you have a computer that does a job unattended, like running a machine in a warehouse. Windows needs to be rebooted from time to time, in order to free up memory, clean temporary files, run updates or whatever reason you may find.
Luckily, the tool to do a scheduled reboot is already available. Here’s how to use such a tool in Windows 10.
Press the WIN key, and start typing Task Scheduler until the program is displayed in the options:
Start it, and take a look at the main window:
Select Create Basic Task, on the right panel. You will be prompted to give it a name:
Then, select when the task is scheduled to run, and at what time of the day:
The next step is to specify what program will run when the task is executed:
Type shutdown, and add the /r argument in the second field. R stands for reboot.
Note: If, for whatever reason, a user is working on that computer, we need to inform him and add a delay, so he can cancel the reboot, if he wants to. We add /t and the time in seconds to delay the reboot. For example, if we want to reboot after 30 minutes, the arguments will be: /r /t 1800. In that case, the user will receive a warning and he will have half an hour to cancel the reboot. He can do that by running shutdown /a at the command prompt, or execute a batch file that contains this command. Argument /a stands for Abort. See the Addendum at the end of this post on how to create a batch file.
Select Finish to complete the task, and we’re done.
To create a batch file that will cancel the reboot, open Notepad, type the words shutdown /a in it, save it with the extension .bat instead of txt and place it somewhere easy to find. When the Scheduled Task triggers the reboot, the user will have 30 minutes to execute that batch file and cancel it.