Code Error 800A01B6 – Object doesn’t  support this property or method

Troubleshooting Code 800A01B6 – Object doesn’t support this property or method:

I find that error 800A01B6 occurs both with Logon Scripts and WMI scripts.  In fact, with Logon Scripts it’s probably the fault of a spelling mistake in a method, whereas with WMI check the .Properties.

  ‡

Introduction to Error Code 800A01B6

This error code, 800A01B6 usually occurs when you execute a VBScript.  One of your commands is not valid.  My guess is that there is a typing error in one of the METHODS in your script.  Another common cause is to forget the ‘Set’ verb at the beginning of a statement.Error 800A01B6 Object doesn't does not support this property or method

Example 1 Logon Script

The script does not execute as you hoped, instead you get a WSH error message. The probably scenario is that you are creating a logon script using a WSH method that does not exist.

The Cause of Code 800A01B6

The secret with Code 800A01B6 is reading what the error box says after ‘… property or method:’.  In the example the error says EnumNetworkDrive and this gives a valuable clue as to what is wrong.

Your VBScript contains an illegal method, probably a typing mistake, an extra letter or space.  In the example, it’s Line 17, EnumNetworkDrive that’s causing the problem, it looks correct, however, research reveals that this method should be plural, EnumNetworkDriveS.

In passing, you may notice that Source: runtime error.  The significance is that error 800A01B6 is not a compilation error which would mean a syntax error.  Runtime errors are often typos which cause logical errors.

The Solutions Object doesn’t support this property or method

Check the syntax of your script, particularly the method that you have used.  Look for clues, particularly in the Line: number.  In my example Line 17 is at fault.  However Char : 1 is a surprise as its actually the method about character 50. 

My advice is get Scriptomatic or Wbemtest and research the correct methods.  Alternatively, in the case of runtime errors you can use this work around.  Add this line: On Error Resume Next.

Example 1 of Script with error 800A01B6

Here is the problem: Set AllDrives = objNetwork.EnumNetworkDrive()

It should be a plural ….DriveS = objNetwork.EnumNetworkDriveS()

‘ VBScript to map two printers from two servers
‘ Guy Thomas February 2010.
‘ ******************************
Option Explicit

Dim objShell, objNetwork
Dim DriveLetter1, DriveLetter2, RemotePath1, RemotePath2
Dim AllDrives, AlreadyConnected, Network1, Network2, i

Set Network1 = CreateObject("WScript.Network")
DriveLetter1 = "S:" ‘ This letter must be in CAPITALS.
RemotePath1 = "\\alan\drivers"

Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
Set AllDrives = objNetwork.EnumNetworkDrive()

AlreadyConnected = False
For i = 0 To AllDrives.Count – 1 Step 2
If AllDrives.Item(i) = DriveLetter1 Then AlreadyConnected = True
Next

If AlreadyConnected = True then
objNetwork.RemoveNetworkDrive DriveLetter1
objShell.PopUp "Drive " & DriveLetter1 & " disconnected."

Else

objShell.PopUp "Drive " & DriveLetter1 & " no initial connection"

End if

objNetwork.MapNetworkDrive DriveLetter1, RemotePath1
objShell.PopUp "Drive " & DriveLetter1 & " connected OK."

WScript.Quit
‘ End of Script

Guy Recommends:  A Free Trial of the Network Performance Monitor (NPM)Review of Orion NPM v11.5 v11.5

SolarWinds’ Orion performance monitor will help you discover what’s happening on your network.  This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.

What I like best is the way NPM suggests solutions to network problems.  Its also has the ability to monitor the health of individual VMware virtual machines.  If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.

Download a free trial of Solarwinds’ Network Performance Monitor

Example 1b of Script with 800A01B6

Here is a simple fault, line 1 should be :

Set ObjNetwork = CreateObject("Wscript.Network")

Omitting the speech marks causes the error:

Set ObjNetwork = CreateObject(Wscript.Network)

Horribly wrong version

ObjNetwork = CreateObject(Wscript.Network)
Wscript.Echo objNetwork.UserName

Correct Version

Set ObjNetwork = CreateObject("Wscript.Network")
Wscript.Echo objNetwork.UserName

Example 2 Error 800A01B6  – WMIError 800A01B6  - WMI

This example shows a WMI script.  If you look carefully, then you can see a property that does not exist – STUPID.

With Error 800A01B6 in WMI script I find that the error is caused by copying and pasting scripts and not keeping your eye on the Win32_xyz object.  These objects have different properties, therefore, you cannot expect to change Win32_Bus to Win32_DiskDrive and expect the script to work.  No you need to check the properties.  In the case of this example, we get the line number and the name of the offending property.

‘ ShellTwo.vbs
‘ Template for a WMI script to interrogate Win32_Objects
‘ Author Guy Thomas https://computerperformance.co.uk/
‘ Version 2.2 – June 2010
‘ ——————————————————–‘
Option Explicit
Dim objWMIService, objItem, colItems, strComputer

‘ On Error Resume Next
strComputer = "."

‘ WMI Core commands to connect to object database
‘ ============================================
Set objWMIService = GetObject("winmgmts:\\" _
& strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery(_
"Select * from Win32_Bus")

‘ VBScript loop containing WMI Properties
‘ ============================================
For Each objItem in colItems
Wscript.Echo "Computer " & strComputer & vbCr & _
"Caption: " & objItem.Caption & VbCr & _
"STUPID " & objItem.STUPID & VbCr & _
"Description: " & objItem.Description & VbCr & _
"Name: " & objItem.Name & VbCr & _
" (More Properties in production script)"& VbCr & _
""
Next
WSCript.Quit

‘ End of Template WMI Sample VBScript

 

See More Windows Update Error Codes 8004 Series

Error 800A101A8 Object Required   •Error 800A0046   •Error 800A10AD   •Error 800A000D

Error 80048820   •Error 800A0401   •Review of SolarWinds Permissions Monitor

Error 80040E14   • Error 800A03EA   • Error 800A0408   • Error 800A03EE

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