Error Codes 8004 Series Home
Errors beginning with 8004xxx point to a WMI (Windows Management Instrumentation) error in your VBScript. Error Code 8004 Series – Mainly WMI
‡ Also
Example Error Code 80041021 Windows Script Host Message
The script does not manipulate the WMI object as you had hoped, instead you get a Windows Script Host error message like this picture: Case 1 Your VBScript contains a misspelled object name. Code 80041021 is an unusual Error in that a number is returned rather than ‘Syntax Error’ or other message. In my example the fault was in a WMI script, the cause was a syntax error with Set objWMI = GetObject("winmgmts:" Correct Wrong The SolutionI solved this 80041021 error message by paying close attention to the line number. In addition, I compared the scripts to other WMI examples. In one case it turned out to be a missing \\ in Set objWMI = GetObject("winmgmts:\\"….. In another case it was a missing & "{impersonationLevel=impersonate}!\\" _
If you are stuck try a parallel troubleshooting approachSuppose that your mission is to create a WMI script which interrogates Win32_ComputerSystem, but the script just won’t work. Instead of going around in circles, try substituting a different Win32_Object. If that also fails, look for a common cause, for instance, the fault with: GetObject("winmgmts:" & "{impersonationLevel=impersonate}! By trying a parallel approach you can isolate the error. See more general troubleshooting ideas Also for more help with WMI Script, visit this section.
|