If you're lucky, it can only be a software problem. Try to break the cycle by pressing F8 right after the HP logo. This should start your laptop in Safe Mode with Networking. Then, you'll need to see what's causing the problem. If you installed a new program or update just before this repeated shutdowns started, then you'll need to uninstall this program, or revert to the previous state of your computer using the Restore option (In Control panel-System). While you're in safe mode follow these great instructions for setting up PC security and check your system for viruses and malware
. Sometimes they may cause unpredictable problems and random shutdowns could be one of them.
If you're not so lucky, you may be facing a power adapter failure, or a motherboard failure.
To test the power supply, run the laptop on battery only and see if it boots up OK. If the laptop's OK on battery alone then you'll need a new power supply. Go for a new one, specifically made for your laptop model, substitutes may not be within the accepted tolerance and you may end up having two useless adapters. Play it safe, get a matching/original brick.
If the laptop keeps restarting with or without the power supply, and you can't even get it to go into Safe Mode you may be looking at a motherboard problem. The most common power-related failure of the motherboard is the Maxim 1987 power regulator failure (learn how to repair this)
. Another option would be a FSB chip failure which is also relatively easy to repair
. Lastly, it could be a graphic chip failure, which can be repaired the same way as the FSB chip.
For a more precise diagnosis provide some more details of the messages you see on the screen, how far it gets to load Windows (if at all), can you see any LED blinks, sounds you hear etc. The more descriptive and detailed you are, the easier it is to get to an accurate diagnosis.
If this post was helpful and informative please vote for it with a Thumb Up. Thank you.