How To Find Windows 10 Product Key Using CMD, PowerShell, And Windows Registry?

Share on twitter
Share on whatsapp
Share on facebook

If you are trying to reinstall your Windows 10, it’s possible that you’ll be stuck at some point due to the lost Windows product key. However, using some simple methods that involve PowerShell, Command Prompt, and Windows Registry, you can easily find Windows 10 product key.

These methods are a lifesaver for every Windows user, especially, the ones running Windows 7 and Windows 8 as well. They just need a couple of steps. I, personally, find it hard to understand why Microsoft makes the process to find Windows 10 product key so difficult. It could only be explained with the assumption that Microsoft doesn’t want you to use Windows keys from older computers.

After you install Windows operating system on your computer and activate it, Microsoft stores it in Windows Registry–something that’s impossible for humans to read. Nowadays, Microsoft has also stopped putting Certificate of Authority stickers on machines, which showed Windows keys.

Also Read: The Ultimate A to Z List Of Windows CMD Commands You Need To Know

Do you really need a product key?

As you know, Windows 10 is the latest version that Microsoft wants to install on every machine. One major change the came was ‘Digital License,’ i.e., you don’t any 25-digit product key to activate Windows 10 after you reinstall it.

How to find Windows 10 product key digital license

Windows 10 now activates itself automatically using the digital license tied to your Microsoft account. This method is mostly followed by OEMs who preload Windows 10 on their laptops and still.

Still, there could be other reasons why you might want to extract the product key on your Windows PC.

How to find Windows 10 product key using — Windows Registry method

To go ahead with this method, you need to boot into your Windows computer. Now, using a simple VBScript–some of you might have seen it on Microsoft forums–you can read all the binary gibberish written in Windows Registry. This script translates the Registry values into a readable format.

So, just copy and paste the following script in a Notepad window and save its as productkey.vbs by choosing the “All Files” option in “Save as type.”

Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))

Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Cur = 0
x = 14
Cur = Cur * 256
Cur = Key(x + KeyOffset) + Cur
Key(x + KeyOffset) = (Cur \ 24) And 255
Cur = Cur Mod 24
x = x -1
Loop While x >= 0
i = i -1
KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
If (((29 - i) Mod 6) = 0) And (i <> -1) Then
i = i -1
KeyOutput = "-" & KeyOutput
End If
Loop While i >= 0
ConvertToKey = KeyOutput
End Function

After saving this file, just click on it and a new popup window will show your Windows product key in the registry. You can copy or note this down somewhere to use it key recovery registry method

How to recover Windows 10 product key using Command Prompt?

This method to recover Windows product key using CMD is very simple. All you need to do is fire up a Command Prompt window with the administrator rights. To do this, search for cmd in the Windows search bar and right-click to choose the elevated permissions option.

Now, type the following command in Command Prompt and hit Enter:

wmic path softwarelicensingservice get OA3xOriginalProductKey

This step will promptly show your Windows key. Note that this method also works for OEM and Retail key cmd recovery method

How to find Windows License key using PowerShell?

To get back Windows serial key using Windows PowerShell, you need to open a new PowerShell with administrative permissions. Now, type the following commands and press Enter:

powershell “(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey”

This method will now promptly show you your Windows 10, 8.1, or 7 product key.

If these methods don’t solve your problem, you need to contact Microsoft Support or your OEM for Windows activation. You can also use some third-party software to recover your license key. If you’ve got the Windows key, but you need a Windows installation media, feel free to visit our ‘legal’ Windows download guide.

How to find Windows 10 product key by just ‘looking around’?

If you are familiar with a Windows product key, you might be knowing that it’s a 25-character alphanumeric code that’s used to activate the Windows operating system. It looks something like this:


Sometimes, your Windows key could be just located or printed in plain sight. Here are a few ways to find Windows key by just looking around.

This method works better for Windows 7, Windows 8/8.1 as they rely on an actual product key than a license.

1. Windows key on sticker/label:

When you buy a new PC, it comes pre-activated. It’s possible that you don’t need to open your command prompt or play with Windows Registry. Your Windows key could be there right in front of you on a Certificate of Authority (COA) sticker on your computer or included in the original packaging.

If you bought the PC from an authorized Microsoft retailer, you need to find Windows product key on a label inside the PC box.laptop product activation key

The COA sticker on your computer verifies the authenticity of your Windows computer. It could also be found under the battery if it’s removable. If you own a desktop PC, you’ll spot the COA sticker on the side of the desktop case.

2. Windows key in an email from Microsoft

Just in case you bought your Windows copy from Microsoft’s website, you can find your Windows product key in an email from Microsoft guys. The company sends a confirmation mail after you complete the purchase.

3. Find Windows key in PC’s UEFI firmware

These days, OEMs ship computers using a new Windows activation method. Instead of providing a physical Windows key, they store it in your computer’s UEFI firmware or BIOS. So, if you know which version of Windows you are running, you can reinstall the same version, and it’ll activate automatically–without the need to enter a key.

Similarly, if you wish to upgrade your legal and activated Windows 7 or 8.1 computer, you don’t need a key. Microsoft will activate your Windows copy on its own, and you’ll receive a digital entitlement for Windows instead of a key.

Did you find this article helpful? Don’t forget to drop your feedback in the comments section below.

Also Read: Remove Bad Sector In Pendrive | “Do you want to scan and fix Removable Disk” Error In Windows
Adarsh Verma

Adarsh Verma

Fossbytes co-founder and an aspiring entrepreneur who keeps a close eye on open source, tech giants, and security. Get in touch with him by sending an email — [email protected]
Scroll to Top