Best answer as chosen by user poyeasfy: Look into...
Since, it powers-up when you remove the AC cord and then reurn it it, that suggest some power logic ckt. action. In other words its on the mtrbd. itself. Basically, when removing AC power you also remove the "warm-up ckt. for logic which is why you can turn it ON, when it fact all you're doing is telling to become ON. In other words this isn't a direct AC ON/OFF switcha s you suspect. Once the logic ckt. is drained it allows itself to be reset to default state, OFF. For whatever reason, the mtrbd. is hosed. While you can swap or replace the PSU or AC adapter brick, usually it would provide a quick status if everything working. Since, it's not, then your have an int. repair. Robert, provided a work-around to hope it does this always to ON/OFF the AIO type PC. Repair and downtime maybe too much for this PC, so consider the fix. Next, you may want to fiddle with power setting and see if anything is related, though I think not, just an area to check. If the CMOS battery is somehow at fault, you would think it would reset bios setting over time, check &bverify is anything has come-up as such, otherwise disgard advise. Below is what HP provide on "start-up problems":
I always check HP/Compaq customer posted problems as they may zero-in on common issues. Also, you can query there to see if they help, it's a free service, but you have to wait for any reply.