Very tricky error. The clue is in the name after Error: in the message box.
Introduction to Code 800A01F5
Error code, 800A01F5 occurs when you execute a VBScript. This is a
runtime error, check your objects and strings.
The Symptoms You Get
The script does not execute as you had hoped. Instead you get a WSH message
box like this picture:
The Cause of Error 800A01F5
Your VBScript contain is a misuse of a string or object variable.
The clue here is in the 'strComp'. What could be wrong? In the
case of this WSH error the logic is faulty, what is required is an object
property, not a str = string property.
Paul DeBrino also reports that trying to set a variable which had
previously been defined as CONST also results in Error 800A01F5.
Incidentally, Source: reports a runtime error not a compilation error, this means you are looking not for a pure syntax problem, but a fault logic error. 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.
Check the syntax of your script. In my VBScript example line 7 is the
problem. With WSH error messages, Char 1, is often unreliable, the
problem could be anywhere on that line.
Check your variables, none should also be CONST.
As a last resort, in the case of runtime errors, you can add this line: On Error Resume Next.
Example of Error 800A01F5 Script
Note: The Line: 7 strComp = OurNetwork.Username.
The problem is that you cannot set a variable to be equal to this particular property (.Username). As the error messages says, this
is an illegal assignment.
' Error 800A01F5 VBScript to to Enumerate your mapped drive
' Guy Thomas February 2010.
Set OurNetwork = WScript.CreateObject("WScript.Network")
Set objDrives = OurNetwork.EnumNetworkDrives
' WScript.Echo OurNetwork.Username &" 's Network drive mappings:"
strComp = OurNetwork.Username
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.