How to retrieve your Windows 10 product key from Command Prompt
You can find your Windows 10 product key by running a single command in Command Prompt. The command pulls the key directly from your system's registry, where Windows stores it after installation. This method works whether you installed Windows yourself or it came pre-installed on your device.
The process takes about two minutes and requires no additional software. You will see your 25-character product key displayed on screen, which you can then copy and save. This is the actual key tied to your device — the same one you would need if you reinstalled Windows or moved it to different hardware.
Key Takeaways
- Open Command Prompt as administrator, then run a single PowerShell command to display your product key on screen.
- The key shown is your actual Windows 10 product key, not a generic placeholder or trial key.
- If the command returns a generic key, your copy of Windows may be tied to your Microsoft account or device hardware instead of a traditional product key.
- Write down or screenshot your product key immediately after retrieving it, since you may need it later for reinstallation or troubleshooting.
- This method works on any Windows 10 device, whether you installed it yourself or purchased a computer with Windows already installed.
Open Command Prompt with administrator rights
Right-click the Start button in the bottom left corner of your screen. A menu will appear with several options. Click Windows Terminal (Admin) or Command Prompt (Admin), depending on which appears on your system. If you see neither option, search for "Command Prompt" in the Start menu, right-click the result, and select Run as administrator.
Windows will ask for permission to make changes to your device. Click Yes to continue. You will now see a black window with a cursor blinking inside it — this is Command Prompt running with the permissions needed to access your product key.
Run the command to display your product key
Copy this entire command exactly as written:
powershell "(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey"
Right-click inside the Command Prompt window and select Paste. The command will appear in the window. Press Enter on your keyboard. The system will process the command for a few seconds, then display your 25-character product key on the next line.
The key will look similar to this format: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX, where X represents letters and numbers. This is your actual Windows 10 product key. Copy it immediately and paste it into a text file or write it down by hand.
What to do if you see a generic key
Some systems display a generic key that looks like it could belong to any Windows installation. This happens when your copy of Windows is tied to your device hardware rather than a traditional product key. Microsoft does this for computers that came with Windows pre-installed from the manufacturer.
If you see a generic key, your Windows installation is still legitimate and activated. You do not need a different key. If you need to reinstall Windows on the same device, Windows will reactivate automatically when you connect to the internet. If you want to move Windows to a different computer, you will need to contact Microsoft support, as device-tied licenses cannot be transferred.
You can check whether your Windows is activated by opening Settings, selecting System, then About. Look for the line that says "Activation". If it says Windows is activated, your system is legitimate regardless of what key the command displayed.
Save your product key in a safe place
Once you have your product key, store it somewhere you can find it later. Create a text file on your computer, save it with a clear name like "Windows 10 Key", and paste the key inside. You can also write it down on paper and keep it with your important documents.
Do not share your product key with anyone else or post it online. Anyone with your key could potentially use it to activate Windows on their own device. If you ever need to reinstall Windows or troubleshoot activation problems, you will need this key, so keeping it safe and accessible is important.
When you might need your product key
You will need your product key if you perform a clean installation of Windows 10 on your device. This means erasing everything on your hard drive and installing Windows from scratch, rather than using the built-in reset option. During the installation process, Windows will ask you to enter your product key to activate.
You may also need it if you contact Microsoft support about activation problems. Support staff can use your key to help troubleshoot why Windows is not activating properly or to reactivate your copy after a major hardware change.
If you are moving your Windows installation to a different computer, you will need your product key to activate it on the new device. However, most product keys are licensed for one device only, so you may not be able to use the same key on multiple computers simultaneously.
Troubleshooting if the command does not work
If you run the command and nothing appears, or you see an error message, make sure you copied the command exactly as written. Check that you did not accidentally add extra spaces or change any characters. Copy it again directly from this page and try once more.
If the command still does not work, your version of Windows may not support this method, or your system may not have a traditional product key stored. In this case, check your Windows activation status by opening Settings, selecting System, then About. If it says Windows is activated, your system is legitimate and you do not need to retrieve a key.
If Windows shows as not activated, restart your computer and try the command again. Sometimes the registry needs to be refreshed. If it still does not work after a restart, your Windows installation may be tied to your Microsoft account instead of a product key, which is common on newer devices.
Frequently Asked Questions
Is the key the command shows the same key I used when I installed Windows?
Usually yes, but not always. If you installed Windows yourself using a product key, the command will show that same key. If Windows came pre-installed on your device, the command may show a generic key or no key at all, because the manufacturer activated it differently. Either way, if Windows shows as activated in your Settings, your installation is legitimate.
Can I use this key to install Windows on a different computer?
It depends on your license type. Most product keys are licensed for one device only, so using the same key on a second computer would violate the license agreement. Check your Windows license terms or contact Microsoft support to confirm whether your key can be transferred. Device-tied licenses cannot be transferred at all.
What if I lost my product key and need to reinstall Windows?
If your Windows is activated and tied to your Microsoft account, you can sign in during reinstallation and Windows will reactivate automatically. If it is tied to your device hardware, it will also reactivate automatically on the same computer. You only need the product key if your Windows is not tied to either your account or your device.
Is it safe to run this command?
Yes. The command only reads information from your system registry — it does not change anything or give access to anyone else. It is a standard Windows command that Microsoft documents officially. Running it will not harm your system or compromise your security.
Why does Windows need a product key if it is already installed and activated?
The product key proves you own a legitimate license to use Windows. Even though Windows is already running on your device, you may need the key later if you reinstall the operating system, troubleshoot activation problems, or move Windows to different hardware. Keeping your key stored safely ensures you can prove ownership if you need to.