Skip to content

Instantly share code, notes, and snippets.

@Roy-Hill
Roy-Hill / GetWindowsProductKey.vbs
Created January 7, 2021 14:49 — forked from craigtp/GetWindowsProductKey.vbs
Retrieve Windows Product Key
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