Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Windows Product Key: How to Find it Using CMD

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To get your Windows product key using the Command Prompt, run the command wmic path softwarelicensingservice get OA3xOriginalProductKey. This command queries the Windows Management Instrumentation (WMI) to pull the digital product key embedded in your computer's UEFI or BIOS firmware. This is the fastest way to recover a key if you have lost your physical sticker or purchase email, provided your device came with Windows pre-installed from the factory.

What You'll Need

  • A computer running Windows 10 or Windows 11.
  • Administrative privileges on the local user account.
  • Access to the Command Prompt (CMD) or PowerShell.

Step-by-Step

  1. Click the Start button or press the Windows key on your keyboard to open the search menu.
  2. Type cmd into the search bar. You will see the Command Prompt app appear in the results.
  3. Right-click on Command Prompt and select Run as administrator. This is a critical step; if you run the prompt as a standard user, the system will deny access to the BIOS/UEFI firmware where the key is stored, and the command will return a blank result.
  4. A User Account Control (UAC) prompt will appear asking if you want to allow this app to make changes to your device. Click Yes.
  5. Once the black Command Prompt window opens, type the following command exactly as shown: wmic path softwarelicensingservice get OA3xOriginalProductKey
  6. Press the Enter key on your keyboard.
  7. The system will process the request. If a key is found in the firmware, it will appear directly below the heading "OA3xOriginalProductKey" as a 25-character alphanumeric string (formatted as XXXXX-XXXXX-XXXXX-XXXXX-XXXXX).
  8. Highlight the key with your mouse, right-click to copy it, and save it in a secure location such as a password manager or a physical notebook.

Common Mistakes

One of the most frequent errors is failing to run the Command Prompt as an administrator. Many users simply press Enter on the search result, which opens a standard user session. Because the product key is stored in a protected area of the system hardware, standard permissions are insufficient to read it. If you see a blank line after the command, you likely missed the "Run as administrator" step.

Another common mistake is a typo in the command. The command is case-insensitive, but the spelling must be exact. Specifically, users often misspell "softwarelicensingservice" or forget the "3" in "OA3xOriginalProductKey." Because CMD does not have an autocorrect feature, a single misplaced character will result in an "Invalid class" or "No instance of class found" error message.

Some users attempt to use this command on a version of Windows that was upgraded from a previous version (e.g., upgrading from Windows 7 to Windows 10) or a version where the license was purchased digitally from the Microsoft Store. In these cases, the key is not stored in the BIOS/UEFI firmware, and the command will not return a result. This is not a failure of the command, but a result of how the license is tied to the hardware or a digital account.

Tips

If you find it tedious to type the long command manually, you can copy the command from this guide and paste it into the Command Prompt window. To paste in CMD, you can usually right-click anywhere in the black window or press Ctrl + V (depending on your Windows version and terminal settings).

For those who prefer a more modern interface, this same command works perfectly in Windows PowerShell or the Windows Terminal app. The process is identical: search for PowerShell, run it as an administrator, paste the command, and press Enter. PowerShell often provides a cleaner visual output for some users.

It is highly recommended to document your product key in multiple places. While the BIOS method is reliable for OEM (Original Equipment Manufacturer) keys, hardware failure on the motherboard can occasionally make this key inaccessible. Keeping a digital backup in an encrypted vault ensures you can reactivate Windows even if you have to replace your hardware.

Troubleshooting

If you followed the steps but the command returned a blank line (no key displayed), try the following solutions in order:

1. Verify Administrator Rights: Look at the top bar of the Command Prompt window. It should say "Administrator: Command Prompt." If it only says "Command Prompt," close the window and repeat the "Run as administrator" step. This is the cause of 90% of blank results.

2. Check License Type: Determine if your Windows license is an OEM key or a Retail/Digital key. OEM keys are pre-installed by the manufacturer (Dell, HP, Lenovo, etc.) and are embedded in the motherboard. Retail keys (bought separately) and Digital Licenses (linked to a Microsoft Account) are not stored in the BIOS. If you have a digital license, this command will not work because there is no physical key stored in the hardware to retrieve. In this case, your activation is linked to your Microsoft account email.

3. Use an Alternative Command: If the first command fails and you suspect you have a different type of license, you can try checking the activation status using slmgr /dli. This will open a small pop-up window showing the current license status, the partial product key, and whether the license is OEM or Retail. While it won't give you the full 25-character key, it confirms if a key actually exists on the system.

4. Restart the WMI Service: In rare cases, the Windows Management Instrumentation service may be hung. Restart your computer and try the command again. A fresh boot ensures that the system services required to query the BIOS are running correctly.

Frequently Asked Questions

Will this command work on Windows 7?

No, this specific command is designed for Windows 8, 10, and 11, as it relies on the OA3.0 specification for storing keys in the UEFI firmware. Windows 7 typically used a COA (Certificate of Authenticity) sticker attached to the laptop chassis or desktop tower.

Is it safe to run this command?

Yes, this is a read-only command. It does not modify any system files, change registry settings, or alter your activation status. It simply requests information that is already stored on your motherboard.

What is the difference between an OEM key and a Retail key?

An OEM key is tied to the first motherboard it is activated on and cannot be moved to a different computer. A Retail key is purchased independently and can be transferred to a new PC, provided it is deactivated on the old one.

Why is my key different from the one I bought?

If you see a key that doesn't match your records, you might be seeing a "Generic Key." Microsoft uses generic keys for certain versions of Windows (like Pro or Home) during the upgrade process, while the actual activation is handled by a digital entitlement linked to your hardware ID.

Can I use this to find a key for a different computer?

No, this command only retrieves the key embedded in the local machine's firmware. To find a key for another computer, you must run the command on that specific device.

What if I have a digital license?

If you have a digital license, you do not need a product key. Your hardware ID is stored on Microsoft's activation servers. When you reinstall Windows, simply select "I don't have a product key" during installation, and Windows will automatically activate once you sign in to your Microsoft account and connect to the internet.