How to find a lost Windows key

We recently went to upgrade a laptop hard drive and realized our sticker on the Laptop was warn through. Luckily with a little research we found a fairly easy trick that will allow any Windows system to get the product key easily.

The first step is to open notepad. Once it’s open you need to cut and paste this code:


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

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


Once you paste the code into your notepad file you will need to save it, we suggest saving it to your desktop for easy access. When you save the notepad file you need to change the “Save as type” to “All Files”.

Then save the file under the name: productkey.vbs

Once you have saved the file with the correct name and code you simply click the file and will get the local Windows product code.