Create a .bat file
*For shutdown change -r to -s
* -r : restart
* -s : shutdown
* -f : force all running application exit/terminate
* -t :specifies the countdown time(seconds) until the shutdown
2. Save the notepad as .bat file.
3. Go to Computer --> Manage --> right click Task Scheduler --> Create Task
4. In General, put a Task Name, set a user account running the task, configure for windows 7/windows server 2008 r2