often times when a system error occurs windows will automatically reboot in your case the system error is happening on shut down therefore by disabling automatic restart we can get the error and diagnose the problem

let us know what the error is if you get one. good luck.
Right-click on My Computer, click Properties, click the Advanced tab. Under “Startup & Recovery,” click Settings. Under “System Failure,” uncheck the box in front of “Automatically restart.”