I had this happen one time with a computer and my power button was stuck i replaced it and it worked fine. Try unplugging the power switch and then starting it by jumping the pins. Also like the other person says a cpu overheating is the main thing that causes a system to shut down after starting up because the bios sees the cpu is getting too hot and doesnt boot all the way. Also if the cpu was shorted in some way it may do the same thing making you think it was overheating. Generally if you have a heatsink and fan on it everything is running and clean it shouldnt be turning off that quickly. With that said it should NOT power itself back on if that is the case i fully suspect the power switch or possibly even the reset switch acting weird too. Hope that helps if all else fails try reflowing the cpu and gpu thats your last effort i can think of.
+
== Update ==
+
+
Okay well as long as you know the power button isnt a problem that is good. It still doesnt make any sense to me how it would power on by itself without something like a power or reset button having a fault. The power cables are another good possibilty but usually dont go bad just get loose and then short out the system so that is possible but really doenst explain powering on by itself that is the real confusing part. Now overheating is not going to be something you can see even with a magnifier and a lot of experience it can look perfectly fine and clean and still had an overheating issue that make a crack or something in the solder joint. Before anything i would have to advise you to try a known good power supply because even if the voltages are right something can be going on inside i really suspect that if it literally turns on by itself with you doing nothing at all because i just dont see any possibility of a bad cable restarting the system unless its just how macs do when they short restart instead of turn off but that really doesn't make sense. If youve exhausted all options seriously i would reflow the board i have done this with consoles graphics cards bad motherboards using a heat gun and had 100% success even though i know it sounds kinda weird. Everything i reflowed looked perfectly fine but all it took was a reflow and they work perfectly and instantly.
I had this happen one time with a computer and my power button was stuck i replaced it and it worked fine. Try unplugging the power switch and then starting it by jumping the pins. Also like the other person says a cpu overheating is the main thing that causes a system to shut down after starting up because the bios sees the cpu is getting too hot and doesnt boot all the way. Also if the cpu was shorted in some way it may do the same thing making you think it was overheating. Generally if you have a heatsink and fan on it everything is running and clean it shouldnt be turning off that quickly. With that said it should NOT power itself back on if that is the case i fully suspect the power switch or possibly even the reset switch acting weird too. Hope that helps if all else fails try reflowing the cpu and gpu thats your last effort i can think of.