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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

0x80041021 error and I can't see why

Status
Not open for further replies.

elmurado

IS-IT--Management
Jul 15, 2003
673
AU
Hi guys,
I have this piece of code:

Code:
For Each strComputer in PCList
Set oWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\CIMV2")
Set oShell = CreateObject("WScript.Shell")
If oFSO.FolderExists("\\" & strComputer & "\c$\Program Files\PDFCreator\") Then 
WScript.Quit

and I keep getting an error 0x80041021 even though the script finishes properly and the software I need is installed-so I'm guessing that WMI is connected to correctly.
It references this line:
Code:
Set oWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\CIMV2")



Can anyone see what is wrong? I think it is a syntax thing but it looks fine.
 
Could WMI be corrupter on one or more of the machines you are connecting to?

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Thanks dm-I can't imagine it being corrupt on more than one. My PClist array contained 10 machines.

Is there a way of checking?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top