Skip to content
Windows

How to Find Your Windows Product Key Using Command Prompt

If your PC came with Windows, the key is usually stored in its firmware and one command reveals it. Many PCs don’t need a key at all because they use a digital license linked to the hardware or your Microsoft account.

Updated
Time
3 minutes
Difficulty
Easy
Applies to
Windows

By Published Oct 6, 2026

Quick answer

  1. 1 Right-click Start and open Terminal (or Command Prompt).
  2. 2 Run: (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey
  3. 3 On older Windows you can also run: wmic path softwarelicensingservice get OA3xOriginalProductKey
  4. 4 If nothing appears, check Settings > System > Activation: you probably have a digital license.
On this page
  1. Before you start
  2. Show the key stored in your PC’s firmware
  3. Check whether you even need a key
  4. If the command shows nothing
  5. Troubleshooting
  6. Frequently asked questions

Before you start

  • A Windows PC

Method 1 Show the key stored in your PC’s firmware

  1. Step 1: Open Terminal

    Right-click Start and choose Terminal (PowerShell).

  2. Step 2: Run the command

    Paste the first command below and press Enter. The 25-character key appears if your PC has one stored.

  3. Step 3: Older Windows: WMIC

    In Command Prompt, the second command works on Windows 10 and older Windows 11 builds. WMIC is turned off by default on recent Windows 11, so use PowerShell if you see an error.

PowerShell (Windows 11 and 10)
(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey
Command Prompt (WMIC, older systems)
wmic path softwarelicensingservice get OA3xOriginalProductKey

Method 2 Check whether you even need a key

  1. Step 1: Open Activation

    Go to Settings > System > Activation (Windows 10: Update & Security > Activation).

  2. Step 2: Read the status

    Windows is activated with a digital license or …linked to your Microsoft account means you don’t need a key: reinstalling on the same PC reactivates automatically.

If the command shows nothing

  • Retail copies: the key is on the card in the box or in the confirmation email from the store.
  • Bought from Microsoft Store: check your order history at account.microsoft.com.
  • Upgraded from Windows 7/8/10: you usually have a digital license, no key needed.
  • Work or school PCs: activated by your organisation; ask IT.

Troubleshooting

“wmic is not recognized”

WMIC is disabled on recent Windows 11. Use the PowerShell command instead.

The command returns a blank line

No key is stored in the firmware. Check Activation for a digital license or look for your retail key.

Frequently asked questions

Can I use the same key on another PC?

OEM keys (from the PC maker) only work on that PC. Retail keys can be moved to a new PC if removed from the old one.

How do I link my license to my Microsoft account?

Sign in with a Microsoft account on the PC. In Activation, you’ll see “linked to your Microsoft account”, which helps reactivate after hardware changes.

Summary

Run (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey in Terminal to see your firmware key. If nothing shows, check Settings > System > Activation; most PCs have a digital license and need no key.

Sources

Written by

James Chambo

Founder

James is the Founder and Senior Editor of OnlineHow with more than 20 years of experience in internet publishing.