How to Explore Product Key in Windows 10, 8, 7 Using VBScript

 
Explore Product Key in Windows 10, 8, 7. If you have placed Product key of this Microsoft’s Operating System and can’t recover, then we have a remedy. You can use the VBScript to do the same very straightforwardly. We will give here the VBScript hence, the remaining job for you will be only to do a double click. Furthermore, we will also write the steps to Explore Product Key in Windows 10, 8, 7.

 

How to Explore Product Key in Windows 10, 8, 7

Step 1 – Open Notepad with the method you feel comfortable.

Step 2 – Copy the piece of codes from the block below and paste into Notepad.

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

If (isWin8 = 1) Then
keypart1 = Mid(KeyOutput, 2, Last)
insert = "N"
KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
If Last = 0 Then KeyOutput = insert & KeyOutput
End If

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

Step 3 – Click on File on the Notepad followed by Save.

9592_file_save_drop_down_notepad

Step 4 – When Save as Dialogue box appears, give a name it of your choice but, remember to write file extension .vbs. For example, if you will write a name product and .vbs next to it then the full name of the file will be product.vbs.

9594_save_as_dia_og_box_change_file_name_notepad

Step 5 – Finally, hit Save button visible at the bottom of the dialog box. Therefore, the .vbs file is saved in your desired location.

9593_pruduct_vbs_file_on_desktop_windows_10

Step 5 – At last, make a double click on the just created file (For me it is product.vbs). Consequently, a pop up materializes on the screen revealing what the product key of your Windows 10, 8, 7 is.

How to Explore Product Key in Windows 10, 8, 7

Step 6 – Hit Ok button on the Pop up to get windowskeyinfo.txt showing the details of the product it in a notepad.

9595_WindowsKeyInfo.txt_notepad

Simply Download and Run VBScript

If you don’t want to take tension to follow these steps then we have placed the VBScript to below. Simply click the download button to grab it on your Windows. Once the download gets over, perform a double click run it.

How to Explore Product Key in Windows 10, 8, 7 Using VBScript

Hence .vbs file functions as a dream in order to Explore Product Key in Windows 10, 8, 7.

Tagged with 
           

  • How to Backup Product Key of Windows 10, 8.1 – 3 Steps
  • How to Free Upgrade from Windows 10 Home to Pro
  • How to Retrieve Product Key of windows 8

  • Related Articles
  • How to Name your Folder on Start Menu in Windows 10
  • How to Enable Dark Mode in File Explorer on Windows 10
  • How to Add Screen Snipping to Pen & Windows Ink in Windows 10


  • One thought on “How to Explore Product Key in Windows 10, 8, 7 Using VBScript

    1. Thanks a lot for the share it really helped me alot.

    Leave a Reply

    Your email address will not be published. Required fields are marked *