Hi, is the pc also starting-up without you using the Power button on front of the PC?
If so, you'll need to power-off, unplug from the wall and check every connection on the motherboard is properly made. Especially the front-panel connectors.
Remember the anti-static rules and discharge any static you may have on you by touching the power supply and chassis and keeping some skin in contact with the case while your hands are near the motherboard.
Use the manual to guide you with this. If you don't have one the download it.
Here's your pc's page at Compaq.
http://h10025.www1.hp.com/ewfrf/wc/d...=378456&dlc=en