Let’s perform a bit of troubleshooting first. You mentioned checking and replacing the VGA cable. Have you tried some of the other video ports? The easiest one to try would be HDMI, as you could connect it to an HDTV to see if it’s just a problem with your VGA port. I doubt that is the reason, because you mention it reboots after about 10 seconds, but it’s worth a try. You also said that you changed the CMOS battery, but let’s try clearing CMOS using the jumper located on the motherboard. You can do this by following the steps outlined in your motherboard’s manual:
Should this not work, we may need to begin testing components. Do you happen to have a replacement power supply or a power supply tester handy? Power supply testers can be bought pretty cheap from virtually anywhere computer parts are sold (or Amazon/eBay) and can help you quickly identify if your power supply is at fault. Without a tester, a replacement power supply would be handy to have to connect and see if your computer properly powers on and boots.
Should the power supply seem to be ok, let’s try something else. With the power cable removed from the computer, remove all RAM modules from the motherboard, reinsert the power cable, and then power on the computer without any RAM installed. Does the computer produce a series of beeps? If so, go ahead and power off the computer, disconnect the power cable, and reinsert the RAM modules and try to power on again.
If the computer produces no beeps, then your computer would seem like it’s not passing POST (Power On Self Test), which is a low-level, fundamental test that computers go through before boot takes place. This would indicate that your motherboard would be at fault and would need replacing. Your model seems to use the P8H77-M-PRO motherboard.
Hope this helps.