Skip to content

Find your Windows product key without installing third-party software

How to find Windows 7-8-10 Product Key using CMD, PowerShell, Windows Registry

If you are troubleshooting your PC, re-installing Windows on PC or virtual machine you will need Windows product key. The 25 long character is quite hard to memorize. You may store the key and forget about it. There are third-party apps available that can find your product key but why would do such hassle of searching and installing other apps when you can easily find your product key from the command prompt, Windows PowerShell or Windows Registry. Installation of such a third-party may cause privacy issues and you do not want that.

Windows Command Prompt

Command Prompt is a powerful command-line interpreter application used for executing different commands.  It is officially called Windows Command Processor. The command lines you type are not case sensitive. Using CMD, you can do most of the action you do using GUI.

Windows PowerShell

Windows PowerShell is a Windows command line designed especially for system administrators. This includes an interactive prompt and scripting environment. With PowerShell, you can access the file system, other data stores (Registry, Digital Signature), etc.

Windows Registry

According to Microsoft Computer Dictionary, Windows Registry is ‘a central hierarchical database used to store information that is necessary to configure the system for one or more users, applications and hardware devices’ Registry include data that Windows requires for an operation like user profile, applications installed on the computer, etc.

How to find Windows 7/8/10 product key using CMD, PowerShell, or Windows Registry? 

Method 1: Windows 7/8/10 Product Key Using Command Prompt

  • Run Windows command prompt (cmd) as administrator.
    You can access the Windows command prompt in numerous ways. For more information, please read: 10 Cool Ways to Open Command Prompt in Windows!
  • Type the following command and press Enter.

wmic path softwarelicensingservice get OA3xOriginalProductKey

cmd windows product key
  • Your Windows product key will be displayed as shown.

Method 2: Windows 7/8/10 Product Key Using PowerShell

  • Click on Windows (flag) icon and type ‘Windows PowerShell’ and run it as administrator as shown below.

windows powershell

  • Type the following command and press Enter.
powershell “(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey”
  • Your Windows product key will be displayed as shown.

windows powershell product key

Method 3: Windows 7/8/10 Product Key Using Registry

  • Simply copy and paste the following code on the notepad and save it as productkey.vbs. While saving choose ‘All Files’ on the ‘Save as type’ option.
    This vbs script simply translates Registry values into readable format.

windows vbs script file


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

Double click on the file and it will display product as shown below.

productkey-vbs script file

You can choose any of the methods mentioned above on Windows 7/8/10. If you have any confusion/ querries regarding ‘How to find Windows Product Key’ please comment down. We will try our best to help you.

Next up in the line:

More on Tutorials:

Leave a Reply

Your email address will not be published.