Well, Task Scheduler is absolutely the way to go here.
As it turns out you have everything you need already included in Windows, and while I’ll show you for Windows 8.1, this approach should work with almost any version from XP on.
Since I live in Windows 8’s desktop, not the tiled start screen, I find the easiest way to locate Task Scheduler in Windows 8.1 is to fire up Control Panel by right clicking the Start icon and clicking on Control Panel:
Then, in Control Panel, use its search feature in the upper right to search for “schedule”:
One of the results is “Schedule tasks” which is exactly what we want. Click on that.
Of course, if you’re a tiled start screen user, you can simply start typing “schedule” and get directly to Task Scheduler that way:
In Task Scheduler, click on the “Create Task…” item:
The first tab of the Create Task dialog is the General tab:
I’ve set a Name for the task of “Nightly reboot”, selected “Run whether user is logged on or not”, and checked “Run with highest privileges”.
Next, click on the Triggers tab, and then the New… button:
I’ve set the trigger to happen “Daily”, every day, at 1:00 AM.
Click OK, then click on the Actions tab, and once again click on the New… button:
The action I want to happen is to “Start a program” (the default selection). The program I’ll start is called shutdown, which is included in Windows, and the argument passed to it will be “/r” for restart. (Alternately you can use “/l” to simply log off, or “/s” to shut down the computer. Run “shutdown” in a Windows Command Prompt for even more options.)
You can review the remaining Conditions and Settings tabs if you like, but the default settings there are just fine for this simple task we’ve created.
Click OK once more and ….
Task Scheduler needs your password. This is because we’ve specified that it should run whether or not you’re logged in. The task actually has to log in itself before it can begin. Your password is not stored, but rather a hash or encryption of your password, that’s of no use to anyone other than Windows, is stored.
And you’re done1:
Here’s a short video walking through the process: