This could be a variety of problems, as I had a very similar issue a couple of months ago. Any component in your machine could be the cause. Mine was caused by both a damaged PSU and motherboard, they had to be replaced (fortunately only for postage fees using warranty).
Sorry to say this will be a fairly lengthy test. What you need to do first of all is boot up your computer with:
- CPU installed
- NO sticks of memory (RAM)
- NO hard disks / storage devices
- NO peripheral cards on (PCI-E/PCI/AGP/etc), that means no video card too if you're not using an on-board one
- Literally just CPU and motherboard connected to the PSU
You must also disconnect the power supply cables form hard disks / storage devices, as a PSU will cut off power if a peripheral component like this has a short circuit happening. Ensure data cables are also disconnected.
If your PC doesn't shut itself down this will at least tell you that your CPU, PSU, and motherboard are fine. If successful I'd then test powering on with each stick of memory (RAM) individually until one of them causes a problem. Be sure to run a Memtest86+ session for each stick of memory to ensure it is good (faults usually occur within the 3 tests, only takes a couple of minutes).
If all sticks of memory appear to work fine you can then attach hard disks and a video card (if not using on-board video). You can now continue to add components one by one until one of them stops your computer starting.
If your PC still cuts out even with just the CPU and motherboard and NOTHING else, you have one of the following issues:
- Motherboard BIOS settings (CMOS) corrupted, in which case check your motherboard's manual on how to reset/clear the CMOS data (sometimes it's a button, sometimes a jumper switch, and sometimes it means removing the battery for an hour)
- A short circuit between your motherboard or PSU against your PC case would be less likely as I'm sure this would have killed off the components before 2-3 seconds, but check that none of the circuits are touching the case -- especially the rear of the motherboard
- CPU, PSU, or motherboard is damaged -- you'd need replacement components to verify which one it is, perhaps borrow off someone if you don't have spares