I am replacing the C drive in a Hewlett Packard desktop
If the machine is in warranty, call hp support.
If it's not, look for a CD or DVD that came with your computer. It may have the OS and all the drivers (and shovelware) on it.
If you can't find the CD, assuming the machine won't boot into the OS from the C: drive, can you look at that drive when it's installed on another computer and see a recovery partition? If you can, you may be able to copy that partition to the new C: drive. Alternatively, you may be able to find a program that makes recovery CDs or DVDs. If you can, run that program, and use the CDs to restore your C: drive. If you ran that program when you got your computer, look for the disk(s),
You paid for your OS; you shouldn't have to do it again.