Okay. Since I don't have a Compaq I just want to confirm that the system locks before the Windows Welcome Screen - correct?
Going on that assumption let's check both the hd and ram first.
To run checkdisk, right-click on a command prompt icon and open as administrator. In the command prompt window type: chkdsk /r (then press ENTER). You'll be told the disk is in use and asked if you want to run checkdisk on the next boot. Say yes, exit the command prompt window, and reboot.
To check the ram, download memtest (
http://memtest.org/). Burn it to a cd using a dedicated .iso burning utility (
http://www.petri.co.il/how_to_write_iso_files_to_cd.htm), make sure the cd drive is at the top of the boot order in bios, then boot to the newly created cd and run the utility.
Let's see where we are after those two tests.
Also, please look in device manager - are there any yellow or red symbols? I'm guessing not, but let's make sure.