First, let's disable the automatic restart on system failure.
Open the start menu and type "system" and click "Edit' the System Environment Variables".
Under Start-up and Recovery click settings and under "System Failure" uncheck the box that says "Automatically Restart".
Now the next time the issue happens tell us exactly what the Error code and message says (just the code and attached message, not all that "A problem has occurred and Windows has been shut down to prevent damage" jazz.
Good luck,