Find Your Windows Product Key
Also, there is a program called Belarc Advisor that will scan your computer and compile all types of information, including Windows and other program product keys, hardware information, etc. I've used it for years with no issues. It modifies nothing on your computer, but rather reports and makes suggestions. When the analysis completes, the report opens in your default browser. You'll see a "Scroll to" section on the left for navigating the report. You can use the browser's File menu to save the report as an HTML file on your computer for future reference.
At Belarc Advisor click the Free Download link, follow instructions to download the program and save the file on your computer. Then double click the saved file to install the program.