Computer Performance, Logon Scripts

Code Error 800A01F5 - Illegal assignment

Troubleshooting Code 800A01F5 - Illegal assignment

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.Code 800A01F5 Illegal assignment WSH Script

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. 

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.

The Solutions

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.

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 2004.
' ******************************
Set OurNetwork = WScript.CreateObject("WScript.Network")
Set objDrives = OurNetwork.EnumNetworkDrives
' WScript.Echo OurNetwork.Username &" 's Network drive mappings:"
strComp = OurNetwork.Username
WScript.Echo strComp
WScript.Quit
 

 


Computer Training Software - Recommended Training VideosGuy Thomas recommends Computer Training Software.  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.


Do you have a good example of this error?  If so, then email me I will publish it with a credit to you:

Do you need extra help?

For interpreting the WSH messages check Diagnose 800 errors.

For general advice try my 7 Troubleshooting techniques

 

 *


Google

WebComputerperformance.co.uk

GFi Events Manager

Guy Recommends: GFi EventsManager

Here is a solution to monitor, manage and archive thousands of events that are generated by devices across your entire network.  Get your free evaluation copy of GFI EventsManager.

 

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

Please report a broken link, or an error.