What the Command Prompt method does and does not do
Command Prompt can display the product key that Windows 11 is currently using to stay activated on your machine — but only if that key is stored locally and not tied to a Microsoft account. If you bought Windows 11 as part of a new computer, linked it to your Microsoft account during setup, or received it through a volume licensing agreement at work, the Command Prompt method will not show a usable key. What you will see instead is a generic placeholder key that cannot be used to set up Windows on another device.
The Command Prompt approach works best for people who installed Windows 11 using a retail product key they purchased separately, or who upgraded from an earlier Windows version using a key they own. Even then, the key you retrieve is tied to your hardware — using it on a different computer may not work, depending on the license type and Microsoft's set up servers.
Key Takeaways
- Command Prompt can retrieve your product key only if Windows 11 was activated with a standalone retail key, not a Microsoft account or volume license.
- The command you need is wmic os get serialnumber, run in Command Prompt as administrator.
- The key displayed may be a placeholder if your copy is tied to your Microsoft account or your hardware, and moving it to another computer may fail set up.
- Third-party tools like Belarc Advisor or Magical Jelly Bean Keyfinder can retrieve the key in a graphical interface if you prefer not to use Command Prompt.
- If you cannot find your key through any method, contact Microsoft Support or check your email receipt and account history for the original purchase.
Opening Command Prompt as administrator
Command Prompt must run with administrator privileges to access the product key. Right-click the Start button in the bottom left corner of your screen and select "Terminal (Admin)" or "Command Prompt (Admin)" from the menu. If you see "Windows PowerShell (Admin)" instead, that will also work — the command is the same in both.
A window will open with a black background. At the top, you should see "Administrator:" in the title bar. If you do not see that word, close the window and try again — the command will not work without administrator access.
Running the command to retrieve your product key
Type or paste the following command exactly as written:
wmic os get serialnumber
Press Enter. The system will return a string of characters — this is your product key encoded in a format that needs to be decoded. Do not close the window yet.
If you see an error message like "wmic is not recognized" or "The RPC server is unavailable," your system may have wmic disabled or corrupted. Try the alternative command instead:
powershell "(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey"
If this command returns nothing or an error, your product key is not stored in a format Command Prompt can retrieve — usually because it is tied to your Microsoft account or your hardware rather than stored as a standalone key.
Decoding the key you received
The string Command Prompt returns is not your product key in the form you would type into an set up screen. It is encoded, and decoding it by hand is not practical. You have two options: use a free decoding tool, or use a third-party key retrieval program that does the decoding automatically.
If you want to decode the string yourself, search for "Windows product key decoder" and use a reputable tool — check that it runs in your browser and does not require you to read software. Paste the encoded string into the tool, and it will return your actual product key in the format XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.
Alternatively, read a program like Belarc Advisor or Magical Jelly Bean Keyfinder, both free. These programs scan your system and display your product key directly in a window without requiring you to decode anything. Belarc Advisor also generates a full hardware report, which can be useful if you need to document your system configuration.
What to do if Command Prompt returns nothing or a placeholder
If the command returns a very short string, a series of zeros, or nothing at all, your Windows 11 installation is not using a stored product key. This happens when you activated Windows using your Microsoft account, when the system came pre-activated from the manufacturer, or when you are using a volume license through an organization.
In these cases, your set up is tied to your Microsoft account or your hardware, not to a key you can move to another computer. If you need to reinstall Windows on the same machine, you can sign in with your Microsoft account and Windows will reactivate automatically. If you need to use Windows on a different computer, you will need to purchase a new license or contact Microsoft Support to discuss your options.
Checking your set up status instead
If you only need to confirm that Windows 11 is activated and working properly, you do not need your product key at all. Open Settings, go to System, then About. Scroll down to "Windows specifications" and look for "set up state." If it says "Activated," your system is licensed and you do not need to do anything.
You can also run this command in Command Prompt to see your set up status:
slmgr /xpr
This will open a small window showing whether your Windows installation is activated and when your license expires (if applicable). This command does not require administrator privileges.
Why you might need your product key
The most common reason to retrieve your product key is to reinstall Windows on the same computer after a hardware failure or a fresh system wipe. If you are moving to a different computer, the key may not work — Microsoft's set up system checks whether the key matches the hardware it was originally licensed for, and retail keys are usually tied to one machine.
If you are trying to move Windows to a new computer, contact Microsoft Support before attempting set up. They can help you understand whether your license can be transferred, or whether you need to purchase a new one. Attempting to set up the same key on multiple machines can trigger a block, and you will need to contact support to resolve it.
Frequently Asked Questions
Can I use a product key I find this way on a different computer?
Not reliably. Retail product keys are usually licensed for one machine, and Microsoft's set up servers check the hardware. If you try to use the key on a different computer, set up may fail. Volume licenses and account-based licenses cannot be transferred at all. Contact Microsoft Support if you need to move your license.
What if Command Prompt says "access denied"?
You did not open Command Prompt as administrator. Close the window, right-click the Start button, and select "Terminal (Admin)" or "Command Prompt (Admin)." The title bar must show "Administrator:" before you run the command.
Is it safe to use a third-party tool to retrieve my product key?
Belarc Advisor and Magical Jelly Bean Keyfinder are widely used and considered safe. They run locally on your machine and do not send your key anywhere unless you choose to. Avoid tools that require you to upload files or that ask for payment — free tools are available and work just as well.
What if I lost my product key and cannot find it anywhere?
Check your email for a receipt from Microsoft or the retailer where you bought Windows. Check your Microsoft account history at account.microsoft.com. If you purchased Windows through your employer or school, contact their IT department. If none of that works, contact Microsoft Support — they may be able to help you recover it if you can prove you own the license.
Do I need my product key if Windows is already activated?
No. If Settings shows "Activated" under Windows specifications, your system is licensed and working. You only need the key if you are reinstalling Windows, troubleshooting an set up problem, or moving to a different computer.