Code Error 8004100E – Invalid Namespace Error

Troubleshooting Code 8004100E – Invalid Namespace Error

Introduction to Code Error 8004100E

Error code, 8004100E occurs when you execute a VBScript connecting to WMI (Windows Management Instrumentation).  This is a spelling error check the name of your CIMV2 connection.  Another problem can be an invalid namespace e.g. root\RSOP on a Windows 2000 machine.  (root\RSOP is O.K. on XP and Windows Server 2003)

The Symptoms You Get Code Error 8004100E - Invalid Namespace Error

The script does not execute as you had hoped. Instead you get a Windows Script Host message box like this picture:

The Cause of Code 8004100E

Your VBScript contains a misspelled object name.  Code 8004100E is an unusual Error in that a number is returned rather than ‘Syntax Error’ or other message.

The Solutions

Check the class definitions in the WMI section of the your script.  Pay attention to detail, for example CIM2 or CIM2v are incorrect it should be cimv2 or CIMV2.  If you have an older system, make sure that the class is valid.

  ‡

Example of Error Code 8004100E Script

Note: The Line 13:  & strComputer & "\root\cim2")

It should be & strComputer & "\root\cimV2")

‘ Shell.vbs
‘ Sample VBScript to display very basic BIOS information
‘ Author Guy Thomas https://computerperformance.co.uk/
‘ Version 1.5 – December 2010
‘ ———————————————————‘
Option Explicit
Dim objWMIService, objItem, colItems, strComputer

‘ On Error Resume Next
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" _
& strComputer & "\root\cim2")
Set colItems = objWMIService.ExecQuery(_
"Select * from Win32_BIOS")

Correct Version

‘ Shell.vbs
‘ Sample VBScript to display very basic BIOS information
‘ Author Guy Thomas https://computerperformance.co.uk/
‘ Version 1.5 – December 2010
‘ ————————————————————–‘
Option Explicit
Dim objWMIService, objItem, colItems, strComputer

‘ On Error Resume Next
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" _
& strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery(_
"Select * from Win32_BIOS")

Seven General Troubleshooting Strategies for 800 Errors

  1. Golden Rule – Break Your Script into Sections

  2. Play the Numbers Game

  3. Try a Walk-Through

  4. If You Are Still Stuck Try a Parallel Approach

  5. Change of Scenery

  6. Avoid ‘Over-think’

  7. Find a Sounding Board

Solarwinds Free WMI MonitorGuy Recommends: WMI Monitor and It’s Free!

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.  Fortunately, SolarWinds have created the WMI Monitor so that you can examine these gems of performance information for free.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor


Do you need additional help?

Give something back?

Would you like to help others?  If you have a good example of this error, then please email me, I will publish it with a credit to you:

If you like this page then please share it with your friends