This should be a simple thing; I think I have been staring at it too long. I'm looking to query a registry key through WMI on a number remote machines because some genius disabled Remote Registry. I have the following in vbscript format that works just fine:
This should be a simple conversion, but I am getting hung up on the strValue. I have tried a number of different ways but am unsure how to capture the value. Any assistance would be appreciated.
const HKEY_LOCAL_MACHINE = &H80000002 dim filesys, filetxt Set filesys = CreateObject("Scripting.FileSystemObject") strPC = "MNCS00258" Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strPC & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5B21A1C6-5F55-480F-816E-C307C1E97293}" strValueName = "DisplayVersion" oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue msgbox(strValue)
This should be a simple conversion, but I am getting hung up on the strValue. I have tried a number of different ways but am unsure how to capture the value. Any assistance would be appreciated.
[ autoit ]
$HKLM = "&H80000002" $filesys = ObjCreate("Scripting.FileSystemObject") $PC = "MNCS00258" $oReg = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $PC & "\root\default:StdRegProv") $Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5B21A1C6-5F55-480F-816E-C307C1E97293}" $ValName = "DisplayVersion" $oReg.GetStringValue($HKLM, $Path, $ValName, strValue) ;<--Unsure what this should be MsgBox(0, "", strValue)