Hum... Ive had problems like that before, check your CPU is not overheating, if it is it will automatically reboot. You can switch it off, but ud likely blow it up.
RAM check your ram, ram will cause your PC to reboot if hard work is needed, or like what hapened to mine, when you inserted a USB device it restarted.
Next a complete format..... FDISK is better, romoves all those virus's in the boot sectors.
Windows Loaded .... System In Danger.
Keyboard Not Found .... Press F9 To Continue.