Got a script that goes out to a list of targets and pulls the uninstall registry info... it gets the Uninstall and it's subkeys and returns those fine... BUT, I need to pull DisplayName, DisplayVersion and UninstallString from each subkey.
From everything I've googled and read, the following SHOULD work: (minus all the irrelevant stuff)
BUT, it doesn't get the VALUES... HELP!!
From everything I've googled and read, the following SHOULD work: (minus all the irrelevant stuff)
Code:
Function RegistryPull(strPCName)
WScript.Echo "Funtion RegistryPull has been called"
Dim objWMIService, Err, objProcess, strShell, objProgram, searchkey
Dim strRem1, subkey, oReg, arrSubKeys, strKeyPath, strValue1, strValue2, strValue3
On Error Resume Next
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
strValue1 = "DisplayName"
strValue2 = "DisplayVersion"
strValue3 = "UninstallString"
Set oReg = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & strPCName & "\root\default:StdRegProv")
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
On Error Resume Next
searchkey = strKeyPath & "\" & subkey
LogFile.Writeline strPCName & "," & searchkey
oReg.GetStringValue HKEY_LOCAL_MACHINE, searchkey, strValue1, strDisplayName
oReg.GetStringValue HKEY_LOCAL_MACHINE, searchkey, strValue2, strDisplayVersion
oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE, searchkey, strValue3, strUninstall
LogFile.Writeline strDisplayName & "," & strDisplayVersion & "," & strUninstall
Next
Set objWMIService = Nothing
End Function 'RegistryPull(strPCName)
BUT, it doesn't get the VALUES... HELP!!