Restarts are often power related. Either your power supply is failing or underpowered, or the voltage regulation modules on the motherboard are failing. Look at all the capacitors (they look like little batteries) on the motherboard and look for brown/orange seepage, if you see some then you will need to replace your motherboard.
Next to test your power supply, unplugg as many devices as possible, remove add-in network and sound cards, unplugg unnecessary USB devices, and rerun your job. If it reboots still then there is a good chance that your power supply is the problem.
Of course, like most computer problems, it is important to rule out software as the culprit. Since corrupted drivers and program files can cause Windows to reboot the computer. The easiest way for you to test this is to re-install Windows. A fresh install of Windows that still reboots will point out a hardware problem.