Forums
New posts
Search forums
News
Security News
Technology News
Giveaways
Giveaways, Promotions and Contests
Discounts & Deals
Reviews
Users Reviews
Video Reviews
Support
Windows Malware Removal Help & Support
Mac Malware Removal Help & Support
Mobile Malware Removal Help & Support
Blog
Log in
Register
What's new
Search
Search titles only
By:
Search titles only
By:
Reply to thread
Menu
Install the app
Install
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Security
Guides - Privacy & Security Tips
Find and recover Windows product key with a VbScript
Message
<blockquote data-quote="Enju" data-source="post: 387635" data-attributes="member: 25121"><p>To easily copy the key push ctrl + c as soon as the window pops up!</p><p>[SPOILER="Or this for fileoutput"]</p><p>Set WshShell = CreateObject("WScript.Shell")</p><p>Set objFso = WScript.CreateObject("Scripting.FileSystemObject")</p><p>Set objFile = objFSO.CreateTextFile("Key.txt", True)</p><p>MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))</p><p></p><p>Function ConvertToKey(Key)</p><p>Const KeyOffset = 52</p><p>i = 28</p><p>Chars = "BCDFGHJKMPQRTVWXY2346789"</p><p>Do</p><p>Cur = 0</p><p>x = 14</p><p>Do</p><p>Cur = Cur * 256</p><p>Cur = Key(x + KeyOffset) + Cur</p><p>Key(x + KeyOffset) = (Cur \ 24) And 255</p><p>Cur = Cur Mod 24</p><p>x = x -1</p><p>Loop While x >= 0</p><p>i = i -1</p><p>KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput</p><p>If (((29 - i) Mod 6) = 0) And (i <> -1) Then</p><p>i = i -1</p><p>KeyOutput = "-" & KeyOutput</p><p>End If</p><p>Loop While i >= 0</p><p>ConvertToKey = KeyOutput</p><p>strKey = KeyOutput</p><p>objFile.Write strKey</p><p>End Function</p><p>[/SPOILER]</p></blockquote><p></p>
[QUOTE="Enju, post: 387635, member: 25121"] To easily copy the key push ctrl + c as soon as the window pops up! [SPOILER="Or this for fileoutput"] Set WshShell = CreateObject("WScript.Shell") Set objFso = WScript.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.CreateTextFile("Key.txt", True) 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 strKey = KeyOutput objFile.Write strKey End Function [/SPOILER] [/QUOTE]
Insert quotes…
Verification
Post reply
Top