How to Find Your Windows 10 Product Key Using the Command Prompt

Windows logo

If you’re looking for your Windows 10 product key, you can find it by entering a quick command at the command prompt. Here’s how: plus an interesting tip for finding the product key using a Windows registry method.

Find your Windows 10 product key using the command prompt

To find your Windows 10 product key using the command prompt, you need to open the command line application with administrative privileges. To do this, type “cmd” in the Windows search bar.

The command prompt will appear in the search results. Right-click on it and select “Run as administrator” in the window that appears. If prompted, enter your Windows account password.

Once open, copy and paste the following command, then press the Enter key:

wmic path softwarelicensingservice get OA3xOriginalProductKey

The 25-digit product key will then appear.

That’s all we can say about it. This method is quick, but it’s probably not code that you will remember very easily. If you want a faster way to access your product key in the future, you can use the Windows Registry method instead.

Find your Windows 10 product key using a Windows registry method

The Windows Registry tip was originally published by a user (whose account is no longer active) in the Microsoft Forum.

First, open Notepad by right-clicking anywhere on the desktop, hovering over “New,” then selecting “Text Document” from the menu.

Copy and paste this code into Notepad:

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

ConvertToKey function (key)
Const KeyOffset = 52
i = 28
Characters = “BCDFGHJKMPQRTVWXY2346789”
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 as long as 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

Then click on the “File” tab and select “Save As”.

In the File Explorer, set the drop-down list “Save as type” to “All files” and give a name to your file. You can use any name, but it must be a .vbs file. You can name it something like: productkey.vbs

Once you have entered a file name, save the file.

You can now view your Windows 10 product key at any time by opening the new file.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.