If the computer keeps turning itself off, it could be due to an electrical short or a serious hardware problem. It could also be because of a power supply issue, electrical shorting within the computer, overheating, loose cables, a memory and expansion card seating issue or a motherboard issue.
Users should check for the correct setting of the power supply voltage switch located at the back of the desktop computer power supply. If the input voltage does not match the country setting, the computer may fail to remain powered. A faulty power supply can result in insufficient power getting into the motherboard, causing the computer to shut off. Users can also check the power button at the front of the computer for any shorting.
Electrical shorting within the computer caused by stray pieces of metal that tend to make an unnecessary electrical connection can cause the computer to shut down without a warning. Users can verify the proper placement of the memory modules and expansion cards in their respective slots.
A computer may shut down if it lacks a firm connection of all the cables in the central processing unit to the motherboard and the appropriate components. Overheating could be another cause for an automatic shut down of the computer. If the computer detects that the fans or the heat sink are not functioning, it turns off. The problem could also be due to a faulty circuitry or a malfunctioning component on the motherboard.