Friday, May 23, 2014

Checking 64bit Registry-Display Version value and storing in varialbe to use in WiseScripts

On error Resume Next
Value = "3.0.85.0"
strComputer = "."
Const HKLM = &h80000002
Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
objCtx.Add "__ProviderArchitecture", 64
objCtx.Add "__RequiredArchitecture", TRUE
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objStdRegProv = objServices.Get("StdRegProv")

Set Inparams = objStdRegProv.Methods_("GetStringValue").InParameters
'Inparams.Hdefkey = HKLM
Inparams.Ssubkeyname = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{100E94A6-F85A-E828-9EE3-C1DD14706B6A}"
Inparams.SValueName = "DisplayVersion"
Set Outparams = objStdRegProv.ExecMethod_("GetStringValue", Inparams,,objCtx)

strValue = Outparams.sValue

If strvalue=value then

SetVariable "CONDITION",success

Else

SetVariable "CONDITION",Failed
 
End If


No comments:

Post a Comment