Hi,
I am running a test using a script to pull the windows key. I know the test works with an OK result but it doesn't appear to provide the key output?
Set WshShell = CreateObject("WScript.Shell")
Set shell = CreateObject("WScript.Shell")
Set getOSName = shell.exec("%comspec% /c wmic os get Caption /value")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
version = getOSName.stdout.readall
wscript.echo version
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
Wscript.Echo ConvertToKey
wscript.quit
End Function
Any ideas?
Extracting windows license key
Are you using Shell Script test method? Then please check the manual related to this test
https://www.ks-soft.net/hostmon.eng/mfr ... m#shellres
The script or external program must write to stdout (standard output stream) single result string. This string should contain 3 parts separated by colon (:).
First obligatory part - marker "scriptres" tells to HostMonitor or RMA that this string is the result string.
Second obligatory part represents the test status, it can take one of the following values (case insensitive):
Third optional part contains Reply value (windows key in your case).
So you missed part 1 and part 2
Regards
Alex
https://www.ks-soft.net/hostmon.eng/mfr ... m#shellres
The script or external program must write to stdout (standard output stream) single result string. This string should contain 3 parts separated by colon (:).
First obligatory part - marker "scriptres" tells to HostMonitor or RMA that this string is the result string.
Second obligatory part represents the test status, it can take one of the following values (case insensitive):
Third optional part contains Reply value (windows key in your case).
So you missed part 1 and part 2
Regards
Alex