본문 바로가기

Computer/Programing

Windows cd-key finder by VBS

1. copy and paste following codes into text editor,

2. save it with extionsion '.vbs'

3. run the vbs file,

4. you will see windows cd-key in popup 

 

 

Set WshShell = CreateObject("WScript.Shell")
winkey = ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
CreateObject("WScript.Shell").Run _
"mshta.exe javascript:eval(""document.parentWindow.clipboardData.setData ('text','" _
& winkey & "');window.close()"")", 0,True
MsgBox(winkey + Chr(13)+ Chr(13) + "Windows Key is copyed to Clipboard")
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

 

pop-up window