Return installed software via Excel macro (Excel 2007)...

B

Big John

I have been trying to enumerate installed software on remote systems using
the following...

strHost = "."
Const HKLM = &H80000002
Set objReg = GetObject("winmgmts://" & strHost & _
"/root/default:StdRegProv")
Const strBaseKey = _
"Software\Microsoft\Windows\CurrentVersion\Uninstall\"
objReg.EnumKey HKLM, strBaseKey, arrSubKeys

For Each strSubKey In arrSubKeys
intRet = objReg.GetStringValue(HKLM, strBaseKey & strSubKey,
"DisplayName", strValue)
If intRet <> 0 Then
intRet = objReg.GetStringValue(HKLM, strBaseKey & strSubKey,
"QuietDisplayName", strValue)
End If
If (strValue <> "") and (intRet = 0) Then
WScript.Echo strValue
End If
Next

....this works, but I am having a heck of time returning distinct product
names. For instance, I will sometimes get two values for Microsoft .Net
Version 2.0 and four values for MSXML 6.

I am not the most skilled VB writer. I have tried to do my own searches for
the solution, but have found nothing that works. I was going to use the
win32_product WMI route, but the majority of the remote machines are Win 2K3.

Ultimately I just want to return all values for .Net and MSXML installs (hot
fixes, service packs, etc.) and I do not care about any other software
installed.

What am I missing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top