Regards,
-Troy
Hi
The Win32_InstalledSoftwareElement and Win32_Product will only give you
information about software that is installed by Microsoft Installer.
Here is a script that enumerates the Uninstall part in registry. Run it with
cscript.exe from a command prompt:
sComputerName = "." ' use "." for local computer
sInstApps = InstalledApplications(sComputerName)
' text block
WScript.Echo sInstApps
' Convert to Array
aInstApps = Split(sInstApps, vbCrlf)
For Each sApp In aInstApps
If sApp <> "" Then
WScript.Echo sApp
End If
Next
' alternativly
'For i = 0 To UBound(aInstApps)
' If aInstApps(i) <> "" Then
' WScript.Echo aInstApps(i)
' End If
'Next
Function InstalledApplications(node)
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Set oRegistry = _
GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& node & "/root/default:StdRegProv")
sBaseKey = _
"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
iRC = oRegistry.EnumKey(HKLM, sBaseKey, arSubKeys)
For Each sKey In arSubKeys
iRC = oRegistry.GetStringValue( _
HKLM, sBaseKey & sKey, "DisplayName", sValue)
If iRC <> 0 Then
oRegistry.GetStringValue _
HKLM, sBaseKey & sKey, "QuietDisplayName", sValue
End If
If sValue <> "" Then
InstalledApplications = _
InstalledApplications & sValue & vbCrLf
End If
Next
End Function
--
torgeir
Microsoft MVP Scripting and WMI
Porsgrunn Norway
-Troy
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3D9D9E0C...@hydro.com...
Thanks in Advance