My compaq 621 notebook pc shipped with Windows 7 Home. It was purchased in 2010. It doesn't boot with Windows 7 or Windows 8 installed (boots after trying for long~10-11 times). It simply shuts down at windows turn-on screen. Even with windows 10 it runs quite fast but still shuts down randomly.
A 10-year old laptop is not going to run Windows 10 well -- primarily due to older hardware which is not up to the task of running Windows 10, and using drivers that have not been optimized for Windows 10. You are lucky that it even works at all!
You said it has to reboot several times to boot off Win 7 and Win8 -- and this implies a failing drive that requires rereading the boot sectors over and over until it gets a good read.
This issue is often due to a failing drive. So, let's check that first, because if it is failing, it would need to be replaced and there is no point then in doing anything else until we confirm that.
To check the drive you have to follow these steps: 1) Press Esc key repeatedly, several times a second, while rebooting the laptop. Do NOT hold the key down, just press it over and over. 2) Eventually, you will see an HP Startup Menu 3) Press the Function key for testing the hard drive (usually F2) and let it run. If the drive checks out OK, then report that and I can provide you options for reinstalling Windows on your PC.
***If my post helped, click the White thumbs-up symbol to say thanks***
***Please mark Accept As Solution if my post solved your problem***
I am a volunteer and I do not work for, nor represent, HP
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".