From the way you describe it you could well have an intermittent short somewhere. Very carefully inspect all the cables. If they're OK, unplug everything except the CPU, RAM and graphics card (with the power disconnected of course). Then reconnect each disconnected item until you find which one is causing the shutdown. If none do then it's the PSU.