How to Find Your Windows 10 Product Key Using CMD
Every copy of Windows 10 is tied to a product key — a 25-character alphanumeric code that activates your license. Whether you're preparing for a reinstall, migrating to new hardware, or just want to keep a record of your license, knowing how to retrieve it from the command line is a practical skill worth understanding.
Here's what you need to know about how the process works, why the results vary, and what affects whether CMD alone is enough.
What Is a Windows 10 Product Key and Where Is It Stored?
A Windows 10 product key is the identifier that links your installation to a valid Microsoft license. When you activate Windows, that key is verified against Microsoft's servers and recorded.
The key itself can be stored in several places depending on how Windows was installed:
- Embedded in the BIOS/UEFI firmware — common on OEM machines (pre-built PCs and laptops from manufacturers like Dell, HP, or Lenovo)
- Tied to your Microsoft account — the case for digital licenses purchased through Microsoft
- On a physical sticker — older machines and retail box copies often have the key printed on the device or packaging
- In the Windows Registry — where the system stores an encoded version of the key
When you run a CMD command to retrieve your product key, you're pulling the encoded value from the registry or firmware, not from Microsoft's servers directly.
The CMD Command to Retrieve Your Windows 10 Product Key
The most commonly used method involves Windows Management Instrumentation (WMI) via the Command Prompt or PowerShell. Here's how to do it:
Using Command Prompt (CMD)
- Press Windows + R, type
cmd, and press Enter - In the Command Prompt window, type the following and press Enter:
wmic path softwarelicensingservice get OA3xOriginalProductKey This command queries the Windows licensing service for the OA3 key — the original product key embedded during manufacturing. If your machine came with Windows pre-installed, this often returns the key successfully.
Using PowerShell as an Alternative
If CMD returns a blank result, PowerShell with a script-based approach is commonly used:
(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey Both commands are querying the same underlying data source, so if one returns nothing, the other likely will too.
Why CMD Doesn't Always Return a Visible Key 🔍
This is where most users run into confusion. The command may return a blank line or nothing at all — and that doesn't necessarily mean there's no license.
The reason comes down to license type:
| License Type | How It's Stored | CMD Retrieval |
|---|---|---|
| OEM (pre-installed) | BIOS/UEFI firmware | Usually works |
| Retail (boxed copy) | Registry (encoded) | May return blank |
| Digital License | Tied to Microsoft account | CMD won't show it |
| Volume License | KMS/MAK server | Not retrievable via CMD |
Digital licenses are the most common reason CMD returns nothing. Since Windows 10, Microsoft shifted toward linking activation to your hardware fingerprint and Microsoft account rather than a traditional key string. In these cases, the "key" doesn't exist as a retrievable character string on your device — the license lives in Microsoft's system.
What Affects Whether the CMD Method Works for You
Several factors determine what you'll actually get back from that command:
How Windows was originally installed A factory-loaded OEM machine is most likely to return a result. A system upgraded from Windows 7 or 8, or one that was activated via a Microsoft account purchase, is far less likely to.
Whether the license is tied to hardware or an account OEM licenses are hardware-bound. Digital licenses are account-bound. These behave differently at every level, including retrieval.
System manufacturer and BIOS version Some older OEM machines store the key in a format that the WMI query doesn't read cleanly. Others may have had the BIOS reflashed, which can affect what's retrievable.
Third-party tools vs. native CMD Tools like ProduKey, Belarc Advisor, or Magical Jelly Bean Keyfinder use deeper decoding methods to extract the encoded registry value. These can sometimes surface a key when CMD returns blank — though the key they display may be a generic OEM key that's the same across thousands of machines of the same model, not a unique activating key.
Understanding Generic OEM Keys vs. Unique Product Keys 🖥️
This distinction matters. Many OEM devices use a generic channel key in their firmware — a placeholder that confirms the license tier (Home, Pro, etc.) but isn't the unique key that was used to activate your copy. If CMD or a third-party tool returns something like VK7JG-NPHTM-C97JM-9MPGT-3V66T, that's a known generic key, not your personal license identifier.
In practice, this means:
- Generic keys cannot be used to activate a fresh Windows installation on different hardware
- They can confirm your edition (Home vs. Pro)
- For reinstallation on the same hardware, you generally don't need the key at all — Windows 10 reactivates automatically via the digital license tied to that machine
What Determines Whether You Actually Need the Key
The practical need for a product key depends on what you're trying to accomplish:
- Reinstalling on the same hardware: Usually no key needed — digital activation handles it automatically
- Moving to a new PC: Retail licenses can transfer; OEM licenses generally cannot
- Backing up for records: Useful if you have a retail key; less critical for digital licenses
- Offline activation: Requires the actual key string, making retrieval more important
Whether the CMD approach gives you what you need — or whether a third-party tool, your Microsoft account, or your original purchase confirmation is the right place to look — comes down to how your specific copy of Windows 10 was licensed and installed in the first place.