Does it shut down after the same amount of time on, or even though it is quick, is it random?
If the shutdown is occurring consistently about 4-5 seconds after startup, check for a shorted power switch or wires. If it is more random and after a longer period of time, heat is more likely the problem.
Since you say the machine is old, another distinct possibility is that capacitors have failed on the mobo or in the PSU. If you see some that are visibly bulging or leaking, it's time to throw in the turban and replace whatever is bad.