Computer Performance, Logon Scripts

Guy recommends :
Free Solarwinds
VM Console

Solarwinds VM Console Free Download

Find out which of your VMs are a waste of space and which VMs need more resources.


Guy's Review of
Computer Utilities

 1) FreePing
 2) Engineer's Toolset
 3) Xobni
 4) PuTTY
 5) WMI Monitor
 6) BgInfo
 7) Net-SNMP
 8) IP Address Tracker
 9) DNS Stuff
10) WinDiff Compare


Code Error 800A01A8 - Object Required

Troubleshooting Code 800A01A8 - Object Required

Error 800A01A8 is medium-difficult error to solve.  The secret of success is knowing where to expect a VBScript method.  Another cause is inconsistent use of script variables.

  ‡

Introduction to Error Code 800A01A8

This error code, 800A01A8 usually occurs when you execute a VBScript.  My suggestion is that there is a typo in an object or method in your script.

The Symptoms You Get Code 800A01A8 - Object required

The script does not execute as you hoped, instead you get a WSH error message.  One possibility is that you are using a WSH object does not exist or has not been declared.

The Cause of Error 800A01A8

Your VBScript contains an illegal method, probably a typing mistake or an extra letter.  Check the logic of your METHOD statement. Note Source: Microsoft VBScript runtime error.

The Solutions to Object Required

Look for clues particularly the Line: number and check the Char: references.  In the example it is Line 4.  Char : 1. In this case it is not Char 1 to blame, more that there is something wrong and none of the line can execute.  Once you have located the line, pay close attention to the spelling of your objects and methods.  Research a similar method in another script.

Alternatively, try adding Option Explicit to the beginning of your VBScript.  My idea is to discover if you have mistyped the name of a variable.

Incidentally, in the WSH message, Source: reports a runtime error not a compilation error, this means you are not looking for a pure syntax problem such as a missing bracket.  The most likely cause is a typo which induces faulty logic.

In the case of runtime errors, you can use this temporary work around.  Add this statement just before the line which errors: On Error Resume Next.

Example 1 of Error 800A01A8

The problem here is a mix up with the singular 'net' and the plural 'nets'.  As we declared nets we should be consistent and in line 3 say:
Set nets (not Set net).

A typo turns into a logical error because nets has not been created, therefore we cannot use it to add a printer.  Incidentally, this is a classic case for always using either singular or plural variables.

' VBScript 800A01A8 Error code - Object required
Dim nets
Set net = CreateObject("WScript.Network")
nets.AddWindowsPrinterConnection "\\lucy4\dotty", "Dot Matrix"

Guy Recommends: The Free IP Address Tracker (IPAT) Free IP Tracker

Calculating IP Address ranges is a black art, which many network managers solve by creating custom Excel spreadsheets.  IPAT cracks this problem of allocating IP addresses in networks in two ways:

For Mr Organized there is a nifty subnet calculator, you enter the network address and the subnet mask, then IPAT works out the usable addresses and their ranges.  For Mr Lazy IPAT discovers and then displays the IP addresses of existing computers. 

Download the Free IP Address Tracker

Example 2 of Error 800A01A8 VBScriptWSH error message Error 800A01A8

This is an example where a vital command or object is completely missing.

As is so often the case, the line number is of great help with code 800xxxxx errors.  Here on Line 19 is the error: Set objUser = (strPath).  In this instance, '[string: "LDAP://cn=elizabeth,"]' tells only part of the story.  There is a problem with cn=elizabeth, but its a missing command GetObject. 

What is missing is GetObject

It should be :Set objUser = GetObject(strPath)

' Bind.vbs  Code Error 800A01A8 - Object required
' Stage 1) Binds to Active Directory
' Version 1.2
' Guy Thomas 18th July 2010


' Commands to bind to AD and extract domain name
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
WScript.Echo "Active Directory Path: " & strDNSDomain
' Edit the next line to reflect your OU
strOU ="cn=elizabeth,OU=Worcester,"
strUser ="cn=elizabeth"


' Building the LDAP path
strPath ="LDAP://"& strOU & strDNSDomain

Set objUser = (strPath)
Wscript.Echo "DN "& objUser.get("distinguishedName")

WSCript.Quit

' End of Example error 800A01A8 Script

I solved this problem using the parallel script technique, finding a similar script that worked and then comparing the statements.

Guy Recommends: WMI Monitor and It's Free!Solarwinds WMI Monitor

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 extra help?

For interpreting the WSH messages check Diagnose 800 errors.

For general advice try my 7 Troubleshooting techniques

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

 


 *


Custom Search

Solarwinds Network Device MonitorSolarwinds' Free Network Device Monitor

Thus utility makes it easy to check the health of a router or firewall.  Check the real-time performance and availability statistics for any device on your network.

Get started with an extensive collection of "out-of-the-box" monitors for popular network devices.  Download your free Network Device Monitor

 

Home Copyright © 1999-2012 Computer Performance LTD All rights reserved

Please report a broken link, or an error.