To find your Windows 11 product key directly from the Command Prompt without reinstalling the OS, open Command Prompt as Administrator and run the command `slmgr /dli`. This will display your product key if Windows was legally activated. The key remains associated with your device and does not require a re-activation step—just copy it from the output for use with a new installation or activation.
What You'll Need
- A Windows 11 PC (preferably running the latest OS updates)
- Admin or elevated rights to run Command Prompt
- A text editor or notepad to copy the key after running the command
- An internet connection (to ensure Windows is fully updated)
Step-by-Step
-
Open Command Prompt as Administrator
Press
Win + Xon your keyboard, then select "Terminal (Admin)" from the menu. If prompted by User Account Control (UAC), click Yes to grant elevated permissions.Labels may differ slightly by region, so search for "Terminal" or "Command Prompt" if the menu wording varies. -
Run the command to display the product key
In the black Command Prompt window, type the following command and press
Enter:slmgr /dliWait a few seconds for the output to appear. If your system was legally activated, Windows 11 will display your product key followed by a message like:License Information: Key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXXIf you see errors like "Error: License Information is not available," your Windows 11 was not legally activated or may be using a trial version. In this case, consider using a recovery key from a legitimate source or reinstalling with a full purchase key. -
Copy the product key
Locate the key number in the output and copy it. It will appear in the format:
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX(a 25-character alphanumeric string divided into five groups). -
Verify no other commands are hidden
Some systems may require additional steps for older versions of Win10/11, but the above command is the standard method for legal activations. For Windows 10, try:
slmgr /xprdif you suspect a trial version, but this does not work for Windows 11 by default.If you’re unsure about the key’s validity, test it by reinstalling Windows 11 with the key and checking activation status.
Common Mistakes
- Running Command Prompt without admin rights Without elevated permissions, the `slmgr /dli` command may fail silently, producing no output. Always open Command Prompt as Administrator.
- Using a trial or unactivated Windows version On a trial or unactivated system, the command will show errors, and the key may be invalid. Ensure your Windows 11 is fully activated before running this method.
-
Skipping the output to copy the key manually
The key may appear in a scrollable window. Use
Ctrl + Ato select all text, thenCtrl + Cto copy it before closing the window. - Mixing command-line methods with other tools Some third-party tools claim to extract keys but may alter system files. Stick to the built-in Command Prompt method.
Tips
- Use the key for reinstallation without reactivation If you need to reinstall Windows 11 (e.g., for updates or troubleshooting), paste the copied key into the activation screen during setup. Windows will recognize it as a valid key without requiring manual reactivation.
- Save the key in a secure location After copying, store the product key in a password-protected file or encrypted cloud storage to avoid losing it during system updates.
- Avoid sharing or selling keys Windows product keys are tied to devices. Sharing them may violate Microsoft’s terms, even if you have one. If you need to transfer ownership, use a hardware key (e.g., OEM keys) or create a new digital license.
- Check for multiple keys on older PCs Some systems may have legacy keys (from Windows 7/8). The `slmgr /dli` command will only show the current activation key. If unsure, try reinstalling with a generic key from Microsoft’s online store.
Troubleshooting
If the `slmgr /dli` command fails or does not display a key, try these steps in order:
- Restart your PC A simple reboot can resolve temporary activation glitches or corrupted system files.
-
Check for Windows updates
Open
Settings > Windows Update > Check for updatesand install any pending updates. Microsoft may release fixes for key-display issues. -
Use a different command for older Windows versions
For Windows 10, try:
slmgr /dli(for installed keys) orslmgr /xprd(to show trial expiration).This method does not work for Windows 11 by default, but it may help identify if the issue stems from a trial or unactivated system. -
Reinstall Windows with a legal key
If all else fails, back up your files, create a bootable USB with the Windows 11 ISO, and reinstall. Enter the original product key during setup to avoid activation issues.
Factory reset or disk partition changes may delete personal files. Use a backup before reinstalling.
- Contact Microsoft Support If the key is missing despite proper activation, Microsoft’s support team can verify your device’s licensing status. Visit support.microsoft.com for direct contact.
Frequently Asked Questions
How do I know if my Windows 11 key is valid?
To test your key, reinstall Windows 11 and enter the product key during setup. If the system activates without prompts, the key is valid. Microsoft’s activation checker can also verify online.
Can I use this command if Windows 11 is running in a VM?
The `slmgr /dli` command works in most virtual machines, but some hypervisors (e.g., Hyper-V) may restrict key output due to licensing restrictions. Try running the command in a native Windows 11 environment if possible.
What if my computer doesn’t show a product key?
If the command returns no output, your Windows 11 may be running on a trial version or without activation. Use a legitimate purchase key from Microsoft or a compatible OEM vendor.
Do I need to reactivate Windows 11 after copying the key?
No, the key remains associated with your device. If you reinstall Windows 11, paste the key into the activation screen—Windows will auto-activate. Do not manually reactivate.
What happens if I run the command in a non-admin session?
The command will likely fail silently. Always open Command Prompt as Administrator to avoid errors.
Can I use this method on Windows 10?
The `slmgr /dli` command was introduced in Windows 10 v1703. For older versions, use `slmgr /xprd` to check trial expiration, but it won’t extract a product key.