What to do if your PC shuts down and automatically reboots

Something in the boot process is crashing the PC. Then Windows reacts to the crash by rebooting.

You need to do three things: stop the rebooting, figure out what’s causing the crash, and fix it. Check this article from PCWorld.com