Do you get any beep error codes when it turns off?
How long does the computer stay on before turning itself off?
Does the CPU's fan spin?
Of so, try cleaning it out w/ some compressed air (the radiator attached to it, that is)
Depending on your skill level, you can also try taking the fan and heatsink off your CPU, and putting it back on with new thermal paste to see if that does anything.
It turns off so quick, like .5 seconds later, I think its the fan, and yes my thermal paste needs to be replace I think. Its something around my cpu for sure, im going to try buying a new fan but at started up I used to get like 4 beeps then it says "cpu fan error" and I go to bios and my cpu was overheating. Then i turned it off and tryed to turn it back on, didnt work.