One reason why a computer spontaniously shuts off is because of overheating, but that is only one reason. Clean out the interior of your computer with a can of compressed air. A clue that it is an overheating issue is if immediately after shutting down you can't restart it. This is because it has not had a chance to cool down yet. If you are able to immediately restart and use the computer, then it is possible that it is not heat related.
If I had to guess based on the little info of your computer I have, I am guessing it is related to the video card. Or video driver.
However I think more info is needed:
Usually when XP automatically reboots it is because Windows recieved an error. We need to make a change to a setting on your computer so we can find out exactly what the error is.
Go to:Start > right click My Computer > Properties > Advanced > Startup and Recovery Settings
and uncheck Automatically Restart
. Now when Windows receives an error it will show you a blue screen.
Blue screens are often called 'Blue Screens of Death' (or BSOD) by users, and 'Stop Messages' by Microsoft. We need to know the exact message you see when you get the blue screen. We especially are looking for a set of letters and numbers about half way down the page that take this format:
This is usually followed by a set of 4 simliar numbers in parenthasis. For now we just need the first set of letter and numbers (before the numbers in the parenthasis).
This will help you diagnose why you are getting the stop messages.