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.
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
- 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
Last edited by a moderator:
bochane
Excellent Member
- Joined
- Oct 18, 2012
- Messages
- 1,400
Did that, but OAx3OriginalProductKey is emptybochane try just tying Get-WmiObject -query 'select * from SoftwareLicensingService' and look for the OAx3OriginalProductKey property.
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.
Added:
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:
cursedboy
Senior Member
- Joined
- Apr 15, 2012
- Messages
- 40
This trick work better for me
1. Open Notepad.
2. Copy and paste the following text into the Notepad window
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.
1. Open Notepad.
2. Copy and paste the following text into the Notepad window
Code:
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"
Do
Current= 0
j = 14
Do
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("wscript.shell")
'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
txt.Close
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.
RichM
Well-Known Member
- Joined
- May 9, 2016
- Messages
- 322
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
Showkey - Windows 10 Forums
catilley1092
Extraordinary Member
- Joined
- Nov 19, 2010
- Messages
- 1,063
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.
Cat
Tried both the regular way & as Administrator, to no avail. Maybe because it's a self-build.
Cat
- Joined
- Jul 4, 2015
- Messages
- 8,998
- Thread Author
-
- #13
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
VBS Script to get the Windows(R) 7 Product Key from a PC's registry. · GitHub
catilley1092
Extraordinary Member
- Joined
- Nov 19, 2010
- Messages
- 1,063
Neemobeer, that did the trick!
Same as shown with Speccy. Mine was an upgrade from Windows 8.1 to 10.
Thanks for the added information!
Cat
Same as shown with Speccy. Mine was an upgrade from Windows 8.1 to 10.
Thanks for the added information!
Cat
Open Notepad.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.
View attachment 31890
- 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
2. Copy and paste the following text into the Notepad window
Last edited by a moderator:
Thank you. I tried it and it was instantaneously shown. I wish that I could code like this myself.This trick work better for me
1. Open Notepad.
2. Copy and paste the following text into the Notepad window
Code: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" Do Current= 0 j = 14 Do 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("wscript.shell") '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 txt.Close 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.
TheDD
Active Member
- Joined
- Feb 3, 2019
- Messages
- 76
This trick work better for me
1. Open Notepad.
2. Copy and paste the following text into the Notepad window
Code: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" Do Current= 0 j = 14 Do 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("wscript.shell") '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 txt.Close 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.
This is the only non third party software that worked for me so far!
isabella123
New Member
- Joined
- Jun 1, 2019
- Messages
- 3
Are you pasting the command above into the PowerShell prompt? (Won't paintings from a regular command activate) Link Removed Pnr Status 192.168.1.1
Last edited:
TheDD
Active Member
- Joined
- Feb 3, 2019
- Messages
- 76
Are you pasting the command above into the PowerShell prompt? (Won't paintings from a regular command activate)
Me? Yes I tried a powershell prompt, then I tried running the same prompt as admin. But both didn't show my key.
It seems like for some people Neemobeer's command works but for some people only cursedboy's command worked
Similar threads
- Replies
- 1
- Views
- 2K
- Replies
- 0
- Views
- 194
- Article
- Replies
- 0
- Views
- 204
- Replies
- 0
- Views
- 469
- Replies
- 0
- Views
- 651