You can download generic Windows 7 windows from microsoft for free but ideally you will also need a COA which you can get off ebay for less than £10.
The only thing that worries me is some laptops that expect a manufacturers version of windows (some dell, hp etc) might not work with a generic COA, tbh I can't remember.
You might have to dig out some drivers, they are on the HP website.
I think most cq71's are capable of running Windows 10, Microsoft download is free, ebay licenses are cheaper. You can run it without a license to try it out, it will nag you occasionally and may not update.
Sorry, Windows 7 is a dim memory these days.