Retrieve your Windows Product Key without extra software


Windows Forum Team
Staff member
This quick tutorial shows you how to retrieve your Windows product key from a working system. This is helpful in cases where your device doesn't have a sticker.

  • Open powershell (Press the Windows Key, then type powershell)
  • Type the following command

The output will be your 25 character Windows product key in the form XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

This should work on Windows 7, 8, 8.1 and 10


Senior Member
Copy & paste below so you don't need to type the command:

$(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey


Windows Forum Team
Staff member
I suppose that would have been helpful, thanks @strollin


Honorable Member
Hm, I just see nothing...:(
I must be doing something wrong :confused:


Senior Member
Are you pasting the command above into the PowerShell prompt? (Won't work from a normal command prompt)


Windows Forum Team
Staff member
bochane try just tying Get-WmiObject -query 'select * from SoftwareLicensingService' and look for the OAx3OriginalProductKey property.


Honorable Member
bochane try just tying Get-WmiObject -query 'select * from SoftwareLicensingService' and look for the OAx3OriginalProductKey property.
Did that, but OAx3OriginalProductKey is empty

I started this PC with Windows 7, bought an SSD and an update to W8 and installed it multibootable. The last step was switching from W8.1 to W10.
Nevertheless I expected a licence.

Same result on my laptop, an empty OAx3OriginalProductKey property. And again it started with XP, got a free upgrate from Acer to W7 and is now running W10

Thanks for looking into it.

Last edited:


Senior Member
This trick work better for me
1. Open Notepad.
2. Copy and paste the following text into the Notepad window

Option Explicit

Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
ProductName = "Product Name: " & objshell.RegRead(Path & "ProductName")
ProductID = "Product ID: " & objshell.RegRead(Path & "ProductID")
ProductKey = "Installed Key: " & ConvertToKey(DigitalID)
ProductData = ProductName  & vbNewLine & ProductID  & vbNewLine & ProductKey
'Show messbox if save to a file
If vbYes = MsgBox(ProductData  & vblf & vblf & "Save to a file?", vbYesNo + vbQuestion, "BackUp Windows Key Information") then
   Save ProductData
End If

'Convert binary to chars
Function ConvertToKey(Key)
    Const KeyOffset = 52
    Dim isWin8, Maps, i, j, Current, KeyOutput, Last, keypart1, insert
    'Check if OS is Windows 8
    isWin8 = (Key(66) \ 6) And 1
    Key(66) = (Key(66) And &HF7) Or ((isWin8 And 2) * 4)
    i = 24
    Maps = "BCDFGHJKMPQRTVWXY2346789"
           Current= 0
        j = 14
           Current = Current* 256
           Current = Key(j + KeyOffset) + Current
           Key(j + KeyOffset) = (Current \ 24)
           Current=Current Mod 24
            j = j -1
        Loop While j >= 0
        i = i -1
        KeyOutput = Mid(Maps,Current+ 1, 1) & KeyOutput
        Last = Current
    Loop While i >= 0
    keypart1 = Mid(KeyOutput, 2, Last)
    insert = "N"
    KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
    If Last = 0 Then KeyOutput = insert & KeyOutput
    ConvertToKey = Mid(KeyOutput, 1, 5) & "-" & Mid(KeyOutput, 6, 5) & "-" & Mid(KeyOutput, 11, 5) & "-" & Mid(KeyOutput, 16, 5) & "-" & Mid(KeyOutput, 21, 5)
End Function
'Save data to a file
Function Save(Data)
    Dim fso, fName, txt,objshell,UserName
    Set objshell = CreateObject("")
    'Get current user name
    UserName = objshell.ExpandEnvironmentStrings("%UserName%")
    'Create a text file on desktop
    fName = "C:\Users\" & UserName & "\Desktop\WindowsKeyInfo.txt"
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set txt = fso.CreateTextFile(fName)
    txt.Writeline Data
End Function
3. Save the text above to a file with the ".vbs" extension on the Desktop.

Bonus tip: To make sure that you saving the file correctly with the ".vbs" extension, you can type its name enclosed in double quotes, for example, "BackupWindowsKey.vbs".

4. Now open your BackupWindowsKey.vbs file

I hope this work for you.



Well-Known Member
Seems like a lot of work to me when Belarc will show the key as will "Show Key" though I realize the other 3rd party ones no longer work after Windows 8.
Showkey - Windows 10 Forums


Excellent Member
Speccy will also show the key in Windows 10.

It works great on Windows 8.1.


Extraordinary Member
Doesn't work on my Windows 10 Pro install.:(

Tried both the regular way & as Administrator, to no avail. Maybe because it's a self-build.:)



Windows Forum Team
Staff member
It may be because of the upgrade. You can try the old vb script way as well. Download the vbs file here and just double click it or from a cmmand prompt type cscript.exe <scriptname>
VBS Script to get the Windows(R) 7 Product Key from a PC's registry. · GitHub


Extraordinary Member
Neemobeer, that did the trick!:D

Same as shown with Speccy. Mine was an upgrade from Windows 8.1 to 10.

Thanks for the added information!:)


This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.