Read your product key and windows version with VBScript.
First, you need to create one file named: productkey.vbs . Edit this file with this source code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | const HKEY_LOCAL_MACHINE = &H80000002 MyRegKeyName = "SOFTWARE\Microsoft\Windows NT\CurrentVersion" MyRegKeyValue = "DigitalProductId" function GetProductKey dim pValues() Set MyBinaryReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") MyBinaryReg.GetBinaryValue HKEY_LOCAL_MACHINE,MyRegKeyName,MyRegKeyValue,pValues Dim sArrayPID sArrayPID = Array() For i = 52 to 66 ReDim Preserve sArrayPID( UBound(sArrayPID) + 1 ) sArrayPID(UBound(sArrayPID)) = pValues(i) Next Dim ArrayProductKeyChars ArrayProductKeyChars = Array("B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9") For i = 24 To 0 Step -1 k = 0 For j = 14 To 0 Step -1 k = k * 256 Xor sArrayPID(j) sArrayPID(j) = Int(k / 24) k = k Mod 24 Next MyProductKey = ArrayProductKeyChars(k) & MyProductKey if i Mod 5 = 0 And i <> 0 Then MyProductKey = "-" & MyProductKey Next GetProductKey = MyProductKey end function function GetOSVersion Set SystemSet = GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem") for each System in SystemSet GetOSVersion = Trim(System.Caption) & ": (" & System.Version & ")" next end function wscript.echo GetOSVersion & vbCrLf & "Product_Key : " & GetProductKey |
How it’s working: You have to select the Windows Registry with two functions: GetProductKey and GetOSVersion. Also, you need to select the entry in the target registry path: HKEY_LOCAL_MACHINE, MyRegKeyName, MyRegKeyValue. The result of these functions will be a… Read More »