[SOLVED] Recovering product key

Jedimaster52082

Distinguished
Apr 25, 2012
8
0
18,510
After years I lost the product keys for me and my wife's copy of windows 7. I would frankly rather be punched in the face than use win10. I am concerned because if i ever have to reformat, I dont have the keys anymore. Is there any way for me to find the key on the computer that has it installed or do i have to try and get Microsoft customer support to help me (doubtful)?
 
Solution
Let me help you.

  • Create a notepad .txt file on your desktop.
  • Open the txt file.
  • Paste this below into your text file.
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))

Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
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


  • Save...
Let me help you.

  • Create a notepad .txt file on your desktop.
  • Open the txt file.
  • Paste this below into your text file.
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))

Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
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


  • Save the txt file.
  • Right click on your txt file and go to properties.
  • Change the file name to productkey.vbs (It will ask you if you want to change the extension name of the file. Click yes)
  • Start the file.
  • You now have your Windows 7 Key.
I'm a programmer so I can assure you that there is nothing wrong in those lines of code. It's just a script that get the key from your registry and show it to you on the screen. When you're done write it down somewhere just delete the file.
 
Last edited:
Solution
Just run this


But if you’re using the same key on both computers that’s not legal
 
Just run this


But if you’re using the same key on both computers that’s not legal

The method I proposed don't make you install a program, take 15 seconds and is gone from your computer by just deleting the file on your desktop.