To get your Windows product key using a command, open the Command Prompt as an administrator and run the command: wmic path softwarelicensingservice get OA3xOriginalProductKey. This retrieves the digital key embedded in your computer's UEFI or BIOS firmware, which is common for laptops and pre-built PCs. If the command returns a blank line, it means your system is using a digital license linked to a Microsoft account or a retail key that was not embedded in the hardware.
Retrieving a product key is essential when you are performing a clean installation of Windows, migrating to a new hard drive, or troubleshooting activation errors after a major hardware change. While many modern computers activate automatically via a digital license, having the actual 25-character alphanumeric key provides a manual backup to ensure your operating system remains genuine and fully functional.
What You'll Need
- A computer running Windows 10 or Windows 11.
- Administrative privileges (you must be logged in as an administrator to access system firmware data).
- A way to record the key, such as a notepad app or a physical piece of paper.
Step-by-Step
- Click the Start button or press the Windows key on your keyboard to open the search menu.
- Type
cmdinto the search bar. In the search results, you will see the Command Prompt app. - 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 data, and the command will fail or return no result.
- A User Account Control (UAC) window may appear asking if you want to allow this app to make changes to your device. Click Yes.
- Once the black Command Prompt window opens, ensure the title bar says "Administrator: Command Prompt".
- Carefully type or copy and paste the following command exactly as written:
wmic path softwarelicensingservice get OA3xOriginalProductKey - Press the Enter key on your keyboard.
- Wait a few seconds for the system to query the firmware. If a key is embedded in your motherboard, it will appear on the line directly below the header "OA3xOriginalProductKey".
- Highlight the 25-character key using your mouse, right-click to copy it, and save it in a secure location.
Common Mistakes
The most frequent mistake users make is forgetting to run the Command Prompt as an administrator. Because the product key is stored in the motherboard's firmware (the UEFI/BIOS), it is protected by system-level security. A standard user account does not have the permissions required to query the softwarelicensingservice. If you simply click "Open" instead of "Run as administrator," the command will likely return a blank space or an "Access Denied" error.
Another common error is a typo in the command. The command is case-insensitive, but the spacing and spelling must be exact. Users often forget the space between path and softwarelicensingservice, or they misspell OA3xOriginalProductKey. Using copy-and-paste from a reliable source is always safer than typing the string manually.
Some users mistake the "Product ID" for the "Product Key." If you go to Settings > System > Activation, you will see a Product ID. This is a unique identifier for your specific installation of Windows and is used for support purposes; it is not the 25-character key used to activate the software. The command provided in this guide specifically targets the activation key, not the installation ID.
Tips
If you find the Command Prompt intimidating, you can achieve the same result using Windows PowerShell. To do this, right-click the Start button, select Windows PowerShell (Admin) or Terminal (Admin), and enter the same wmic command. PowerShell handles the output similarly to the Command Prompt.
For those who prefer a more visual approach, you can use the PowerShell-specific command: (Get-WmiObject -query "select * from SoftwareLicensingService").OA3xOriginalProductKey. This is essentially the same request but written in the native PowerShell syntax, which can sometimes be more reliable on newer versions of Windows 11.
It is highly recommended to store your product key in a password manager or a physical safe. If your motherboard fails and you need to replace it, Microsoft may ask for this key to verify your ownership of the license during the reactivation process. Relying solely on a digital license is convenient, but a physical record of the key is the ultimate safety net.
Troubleshooting
If you ran the command as an administrator and the result was a blank line under the header, do not panic. This does not necessarily mean your Windows is not genuine. It simply means there is no OEM (Original Equipment Manufacturer) key embedded in your hardware firmware.
This happens in several common scenarios. First, if you built your own PC and bought a retail copy of Windows, the key is stored in the Windows Registry or linked to your Microsoft Account, not the BIOS. Second, if you upgraded from Windows 7 or 8 to Windows 10 or 11, your system likely uses a "Digital Entitlement." In this case, Microsoft's servers recognize your hardware ID, and no physical key is required for reactivation as long as the hardware remains largely the same.
If you suspect your key is missing and you are seeing an "Activate Windows" watermark, check your email for the purchase confirmation if you bought a digital license. If the PC was a gift or bought second-hand, check for a COA (Certificate of Authenticity) sticker on the bottom of the laptop or the side of the desktop tower. If none of these work, you may need to contact Microsoft Support to recover a license linked to your email address.
If the Command Prompt freezes or returns a "System Error," try restarting your computer. Occasionally, the WMI (Windows Management Instrumentation) service, which the wmic command relies on, can hang. A simple reboot usually resets this service and allows the command to execute successfully.
Frequently Asked Questions
Will this command work on all versions of Windows?
This command works on Windows 10 and Windows 11. It is designed to pull the OEM key from the UEFI. It may not work on very old versions of Windows (like Windows 7) that used BIOS instead of UEFI, or on systems where the license is purely digital.
Is it safe to run this command?
Yes, this is a read-only command. It queries existing information from your system firmware and does not change any settings, delete files, or modify your registry. It is a standard administrative query.
Why is my key different from the one I bought?
If you have a pre-built PC, the embedded OEM key is different from a retail key. If you later purchased a Pro upgrade, the system may show the original Home key in the BIOS while using the Pro key for actual activation.
What is the difference between an OEM key and a Retail key?
An OEM key is tied to the motherboard and cannot be transferred to a different computer. A Retail key is purchased separately and can be moved to a new PC, provided it is deactivated on the old one.
Can I use this command to find a key for a different computer?
No. This command only retrieves the key embedded in the local machine's hardware. To find a key for another computer, you must run the command on that specific device.
What if I have a digital license instead of a key?
If you have a digital license, the wmic command will return nothing. Your activation is tied to your Microsoft account and hardware ID; simply sign in to your account after reinstalling Windows to activate automatically.