Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 0x80041010 in WMI query

Status
Not open for further replies.

Salyn

MIS
Nov 22, 2002
7
AU
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
 
The laptop probably you can't find sms_def.mof there neither.
 
tsuji,

Thanks for your reply . I have checked that none of my computers- desktops and laptops have the sms_def.mof file. They all run on Windows XP SP1 or SP2. I have no problem to run the script on any desktops except the laptops. What could it be...?

Reagrds,
Salyn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top