Code Error 800A0401 - Expected End of Statement
Troubleshooting Code 800A0401 - Expected End of Statement
Good news, here is another example of a WSH error message with a helpful Char: number. Count along the line until you get to the offending character. With Error 800A0401 start by looking for missing ampersands (&).
Introduction to Code 800A0401
The Symptoms You Get
The script does not execute as you had hoped. Instead, Windows Scripting host generates a message box like this picture: Good news, I have three examples of code: 800A0401.
The Cause of Code 800A0401 VBScript Error
Your VBScript contains a punctuation error. Note: The clue from Source: Microsoft VBScript compilation error, this means a syntax error in your script. In this case the Char: number (33) is particularly valuable in troubleshooting.
The Solution to Error: Expected end of statement
Check the syntax of your script, in particular double-check punctuation marks (&, comma, speech marks or full stop.). In this instance, Windows Scripting Host has detected a mix-up between a comma and a full stop. As ever, a line number is helpful when troubleshooting, moreover, any Char : number other than 1, will pin-point the problem.
Example 1 of Script for Code 800A0401
Note: The error is at Line 3, Character 33 - wbemServices, Instances
It should be wbemServices.Instances (Full stop, and not a comma)
' VBScript Error 800A0401
SolarWinds' Orion performance monitor will help you discover what's happening on your network. This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.
What I like best is the way NPM suggests solutions to network problems. Its also has the ability to monitor the health of individual VMware virtual machines. If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.
Example 2 of Script for Error 800A0401
Wscript.Echo objNetwork.UserName " at " & objNetwork.ComputerName
An & (ampersand) is missing it should be:
Wscript.Echo objNetwork.UserName & " at " & objNetwork.ComputerName
' VBScript 800A0401 Error
Example 3 - Missing Comma
The error is on line 10 char 33, it needs a comma between the drive letter and the UNC path
objNetwork.MapNetworkDrive "R:" "\\alan\backup"
Summary of Error Code 800A0401
As usual with 0800 error codes, check the line number and the char number. Pay careful attention to any punctuation. Is there a comma, missing? Could there be a comma, where the script needs a full stop?
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