I run the following script to collect list of applications installed on computer. It runs very well on desktop but when it is run on laptop (Dell Latitude D600), it failed with an error code of 0x80041010 as Source
null) on objItem. Any advise or helps please...
Dim wshProEnv, objWMIService
Dim CurrentPC, colItems, objItem
Dim sInstallApp, sInstallVer, sResult
Set wshShell = WScript.CreateObject("WScript.Shell")
Set wshProEnv = wshShell.Environment ("Process")
CurrentPC = wshProEnv("Computername")
Set objWMIService = GetObject("winmgmts:\\" & CurrentPC & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32Reg_AddRemovePrograms",,48)
For Each objItem in colItems
sInstallApp = objItem.Displayname
sInstallVer = objItem.Version
sResult = sResult & vbcrlf & "DisplayName:" & sInstallApp & " - " & "Version:" & sInstallVer & vbcrlf
Wscript.Echo sResult
Next
Thanks in advance,
Salyn
Dim wshProEnv, objWMIService
Dim CurrentPC, colItems, objItem
Dim sInstallApp, sInstallVer, sResult
Set wshShell = WScript.CreateObject("WScript.Shell")
Set wshProEnv = wshShell.Environment ("Process")
CurrentPC = wshProEnv("Computername")
Set objWMIService = GetObject("winmgmts:\\" & CurrentPC & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32Reg_AddRemovePrograms",,48)
For Each objItem in colItems
sInstallApp = objItem.Displayname
sInstallVer = objItem.Version
sResult = sResult & vbcrlf & "DisplayName:" & sInstallApp & " - " & "Version:" & sInstallVer & vbcrlf
Wscript.Echo sResult
Next
Thanks in advance,
Salyn