How to Find Your Windows 11 Product Key Using CMD

To find your Windows 11 product key with Command Prompt, open Command Prompt as an administrator and run powershell "(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey". If your PC came with Windows installed, the 25-character key stored in its firmware appears on the next line.

This covers current, supported versions of Windows 11, and the same command works in Windows 10. It shows only an original manufacturer (OEM) key saved in the PC’s firmware. A blank result doesn’t mean Windows is unactivated, and the command can’t recover a key you typed in for a separately bought copy or an edition upgrade.

Why the Old WMIC Command Fails

Most older guides use wmic path softwarelicensingservice get OA3xOriginalProductKey. Microsoft has removed WMIC from currently supported versions of Windows 11, including versions 24H2, 25H2 and 26H1, and it can no longer be added back as an optional feature. Running it now gives an error such as ‘wmic’ is not recognized as an internal or external command.

The command in this guide asks the same Windows licensing service for the same value. It uses PowerShell, which Microsoft recommends in place of WMIC, so you can still run it from Command Prompt.

How to Find Your Product Key Using Command Prompt

  1. Click Start and type cmd.
  2. Select Run as administrator on the right, or right-click Command Prompt and choose it there. See how to run Command Prompt as admin for other ways.
  3. Select Yes in the User Account Control prompt. The window title starts with Administrator: Command Prompt.
  4. Copy and paste this command, then press Enter: powershell "(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey"
  5. Wait a few seconds. If a key appears in the format XXXXX-XXXXX-XXXXX-XXXXX-XXXXX, copy it and save it somewhere private. If the prompt returns with no key, skip to the next section.
Administrator Command Prompt showing the product key command and a partly hidden 25-character key
Run the command and save the 25-character key that appears.

The command only reads licensing information. It doesn’t activate Windows, change your license or send anything to Microsoft.

Use Windows Terminal or PowerShell Instead

On Windows 11, you can also right-click Start, choose Terminal (Admin) and select Yes. Terminal opens PowerShell by default, so run the shorter version of the command there:

(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey

If Terminal opens a Command Prompt tab instead, use the full command from step 4.

What If No Key Shows Up?

A blank result means Windows found no key in the firmware. That’s normal on many PCs. Check how your copy of Windows is licensed:

If you never had a license at all, here’s how to buy a legitimate Windows 11 license from Microsoft or an authorized retailer.

  1. Press Windows key + I to open Settings.
  2. Select System, then Activation.
  3. Read the status at the top. Select it to expand the details if needed.
Illustration of Windows 11 activation details showing a digital license linked to a Microsoft account
Illustration: product-key and activation checks in Windows 11.

Microsoft lists these activation messages:

  • Windows is activated with a digital license or …linked to your Microsoft account. Your PC doesn’t need a key. Microsoft explains that a digital license activates Windows without one, which is common after a free upgrade from Windows 10.
  • Windows is activated. Windows is licensed, but Microsoft doesn’t tie this message to one license type. If the command was blank and you need an actual key, check the purchase records in the table below.
  • Windows is not activated. Read the error shown. You need a valid key or a digital license for this PC.

The Activation page doesn’t show the full 25-character key, but it tells you which kind of license you’re looking for.

Where Else to Find Your Product Key

How you got Windows decides where the key lives. Microsoft’s product key guide lists these sources:

How you got Windows 11 Where to look
Came installed on a new PC Firmware (the command above), the PC packaging or a Certificate of Authenticity label. Ask the manufacturer if none of those has it.
Boxed copy from a store A label or card inside the box
Digital copy from a retailer The confirmation email or the retailer’s online account or digital locker
Digital copy from Microsoft’s website The confirmation email. Microsoft keeps key records only for purchases from its online store, so also check Order history in your Microsoft account.
Free upgrade, or a Pro upgrade bought in the Microsoft Store app No key; you have a digital license
Work or school PC, Volume Licensing or MSDN Your organization’s IT team, or your program’s web portal

The manufacturer will usually ask for the PC’s serial number if you contact them for a lost key.

Check Which Key Windows Is Using

To see part of the key currently installed, type slmgr /dli in Command Prompt and press Enter. A small Windows Script Host box opens with the edition, the license channel (such as RETAIL or OEM) and the last five characters of the key. Compare those five characters with a key you found to make sure it’s the one in use.

Microsoft lists /dli and /dlv (more detail) in its slmgr options reference, and neither needs administrator rights. slmgr is a VBScript file, and Microsoft is retiring VBScript, so a future update may remove it. Microsoft’s Windows IT Pro blog covers the PowerShell commands that replace it.

Two things are not your product key:

  • The Product ID under Settings > System > About identifies your installation. It can’t be turned into a product key.
  • The BackupProductKeyDefault value in the registry, which some guides point to, often holds a generic or different key. Don’t edit the registry to look for it.

If the Command Reports an Error

  • ‘powershell’ is not recognized or the command does nothing. Make sure you pasted the whole command, including both straight double quotation marks. Quotes copied from a document can turn into curly quotes that break it.
  • Access denied. Close the window and reopen Command Prompt with Run as administrator.
  • An error about the command or the term. You may have pasted the long version into PowerShell or Terminal. Use the shorter version without the word powershell and the outer quotes.
  • Blocked on a work or school PC. Your organization may restrict these tools. Ask the IT team for license details.

Do You Need the Key to Reinstall?

Usually not. If this PC already has a digital license or a firmware key, Microsoft says you can reinstall the same edition (for example, Home or Pro), select I don’t have a product key during setup, and Windows activates once it’s online. Back up your files first. See how to wipe and reinstall Windows 11 for the full process.

A firmware key matches the edition the PC shipped with. If you upgraded from Home to Pro, the firmware key won’t activate Pro.

A major hardware change, such as a new motherboard, can deactivate Windows. Linking your digital license to a Microsoft account first (Settings > System > Activation > Add an account) lets you use the Activation troubleshooter to reactivate afterward.

Frequently Asked Questions

Is it safe to share my product key?

No. Treat it like a password. Keep it out of public screenshots, forum posts and support chats with anyone other than Microsoft or your PC maker. Store it in a password manager or another private place.

How do I use the key to activate Windows?

Go to Settings > System > Activation and select Change product key, then enter the key. See how to activate Windows 11 for the full steps.

Do I need a key-finder app?

No. The built-in command reads the firmware key, and your purchase records cover the rest. If you choose a third-party tool anyway, download it only from the developer or the Microsoft Store.

Does a Windows update change my product key?

No. Updates don’t change your key or your activation status.

Can I move my key to another PC?

It depends on the license. An OEM key that came with a PC stays with that PC. A retail copy you bought separately is governed by its own license terms, so check those before moving it.

Join Our Free Newsletter

Featured guides and deals

You may opt out at any time.
Read our Privacy Policy