You can see if you can boot into Safe Mode with or without Networking by going Start - type msconfig and press enter when it comes up.
Under the Boot tab, check the button for Safe boot and Minimal for just Safe Mode or Networking if you want Safe Mode with Networking.
You will need to go back into msconfig to uncheck those buttons to have the machine boot up normally.
However, if you want to factory reset the machine after backing up your personal stuff, you will need to create a System Repair disk to boot up with.
To do this, go Start - Control Panel - Backup your computer then click on Create a system repair disk.
When you've done that, shutdown and tap F12 as you switch on and then use the cursor keys to select the DVD drive, insert the disk and press enter.
Press any key when prompted to boot from CD/DVD.
You will be presented with an inverse window with Windows Setup [EMS Enabled] highlighted - just press enter where the disk will load the Windows files.
Change or confirm the keyboard etc. - wait for it to locate the drive your volume is loaded into and then you can select the HP Recovery - mine is listed as Toshiba HDD Recovery.
This is usually the final solution when none of Windows repairs will resolve.
You will need to reinstall your programs and personal stuff as well as getting rid of any bloat that the computer came with.
I normally use a suitably sized USB flash drive to back up my personal stuff onto which are the Downloads and Documents folders.
However, using msconfig to boot into Safe Mode with Networking and running the Tweaking.com repair program may resolve everything for you without having to use extreme measures.
You should also get into the habit of creating regular system images onto something like an external HDD.
You will need a system repair disk to boot up with to restore from that system image