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
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.
Dim nets
Set net = CreateObject("WScript.Network")
nets.AddWindowsPrinterConnection "\\lucy4\dotty",
"Dot Matrix"
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
' Stage 1) Binds to Active Directory
' Version 1.2
' Guy Thomas 18th July 2004
' 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.
Try
a different solution, download SolarWinds ipMonitor
Here is my thinking,
ipMonitor will give you valuable data about your network and servers.
This extra information just may unlock the solution to your error code.
One more thing, sometimes when troubleshooting you go around in circles;
therefore if you try a different, but related approach, you may just crack the
problem.
Free Download
of SolarWinds ipMonitor
Their topics and material are ideal for getting you started with VBScript. The
videos are easy to follow and you can control the pace. Try their free demo material and then see if you want to buy the full package.
See more about VB Script Training CD.