When I see this, the repair varies with what CDs I have and the amount of time allotted. But if you are going to repair it the usual way then you get your files out first (see first link) then you use the HP Restore Media to reload the OS.
I have a fairly old hp desktop that I have not had a lot of problems with. I have not been using it much. When I turn it on, it asks me to choose safe mode or other, no matter what I choose or just leave it to reboot it will just keep running throught this process and will never boot up.