Troubleshooting Code 800A01F5 – Illegal assignment
Very tricky error. The clue is in the name after Error: in the message box.
Introduction to Code 800A01F5
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:
Example of Error 800A01F5 Script
Note: The Line: 7
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.
See More Windows Update Error Codes 8004 Series
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.
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