It's easy to make computer restart or auto shutdown after 3 hour with cmd code, you just write simple code in batch file. Write down following codes in notepad :
shutdown -s -t 10800 -t “Hi ! This Computer will shutdown After 3 hour”
Save it with .bat extension (ex: Autoshudown.bat ), and run the program with double click on it. The words in quotes is display comment that will be shown when program is running. 10800 is the time for 3 hour (3600=1 hour), you may need read the basic shutdown command