I googled a little bit and I found this
https://h10025.www1.hp.com/ewfrf/wc/...cc=emea_africa
If you click on "where do i find my serial number" it shows you you're supposed to look at the code on the shipping box! Which I'm sure you don't have.
I'd call Compaq and give them any serial number on your PC and maybe they can look up their database and give you the original serial number.
When a DOS program exits, it returns to DOS. If for whatever reason DOS isn't loaded in memory it will ask for the location of command.com. That's the command interpreter (that's the thing that shows you the command prompt A:\> or C:\> and waits for you to enter commands). If you're booting from a CD, the most likely location is
A:\COMMAND.COM
Type in that (with the CD in the drive) and it should return you to your command prompt.