How to Diagnose Code 800 Errors in VBScript

How to Diagnose Code 800xxxxx Errors in VBScript

This section concentrates on VBScript errors found in Logon and WMI scripts.  However, many of the principles also apply to .ASP, COM and ActiveX errors.

Topics for Code 800 ErrorsHow to Diagnose Code 800 Errors in VBScript


The Causes of Code 800 errors

Syntax errors.  The WSH scripting engine parses the lines of your code, if it finds unfamiliar expressions, it halts with an error message.  Syntax errors are caused by the usual suspects, mistyping keywords, forgetting to close brackets or speech marks. These syntax errors always have an ‘A’ as the 4th digit, for example, 800Axxxx.

Runtime errors.  Objects or components that your script requires may not be available, for example, printers or network shares.  Other causes of runtime errors, such as trying to divide by zero are less common in the WSH context.  The characteristic of these external errors is a ‘7’ in the 4th digit, for example, 8007xxxx.

Look for clues in the 800 error message

Put on your detective hat and look for clues in the error message.  As with police investigators, it is collecting information and paying attention to detail, that is the key to solving the VBScript crime.Look for clues in the 800 error message - Troubleshooting VBscript

In addition to the Code: (80040E37) there are 4 other key lines to examine in your WSH error message.

Line: (20)

The line number and to a lesser extent, the char number, give you valuable information on where to start your search for the cause of the error.  When referencing the line number, count every line including blank lines and ‘ Comments.  Best of all, use a good script editor such as OnScript.

Char:  (1)

I find the Char: number less useful than the line number.  This is for the simple reason the value for Char is usually one, even though it’s often not the first word that is at fault.

However, if Char is a number other than (1) then this gives you a big clue.  One area where you get meaningful Char: 58 numbers is with Syntax Errors.

Error:  (Table does not exist)

As well as the Code 800... number, look for keywords in the Error: which indicate what has gone wrong with your VBScript.  For example, is the error indicating an object, network or printer, or as above, ‘Table does not exit’

Source:  (Provider)

The Source: Will often tell you which method is faulty, for example MapNetworkDrive.  In other example, the error message may tell you whether looking for a Compilation error or Runtime error.  Compilation errors are common in the 800A series where they indicate faulty syntax.

Recommended: Solarwinds’ Permissions Analyzer – Free Active Directory ToolFree Permissions Analyzer for Active Directory

I like thePermissions Analyzer because it enables me to see WHO has permissions to do WHAT at a glance.  When you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, and takes into account network share access, then displays the results in a nifty desktop dashboard!

Think of all the frustration that this free SolarWinds utility saves when you are troubleshooting authorization problems for user’s access to a resource.  Give this permissions monitor a try – it’s free!

Download SolarWinds’ Free Permissions Analyser – Active Directory Tool

The Art of Diagnosing 800 Errors

The art of diagnosing 800 errors is knowing which of these four categories is the most important for your particular WSH Message box: 

Line: Is always important – full stop.  Remember that you should count both bland and ‘Remark lines.

Char: Is only important if it’s a number other than 1.  Often 800Axxxx series has a useful number such as, Char:53.

Error: More often than not, the Error message is laden with clues.  Read carefully, then read again paying attention to each and every word.  Study phrases such as Error: ‘Variable is undefined’.  The only series where error is not much help is the 8004xxxx.

Source:  At its best when it names a method in your script.  With the 8007xxxx series, Source: often throws up the name of the offending method, for example MapNetworkDrive.  In addition to a named method, the 800Axxx series may indicate Source: Microsoft VBScript compilation error, this means a problem with your syntax.  On the other hand, the 8004xxxx series often reports (Null), which is not much help.

The Solutions

The first branch of your decision tree is syntax or logic.  Does the error message point to a syntax error? Alternatively, is there a mistake in the script or network logic which triggers the error?  Double check that the name of the share, server, computer or domain actually exists.  Net View from the command line will test that the machine is visible.  To help you decide syntax or logic examine the fourth character, letter ‘A’ indicates a syntax problem, for example: 800Axxxx.  Moreover, even a glance at the Error: line will confirm that a bracket is missing or whatever the syntax fault is in this instance.

On error resume next

If, on the other hand, the error is logical, or a so called ‘runtime errors’ then the fourth digit is likely to be a ‘7’.  Good news, you may be able to provide a temporary cure by adding:  On error resume next.  However this should not be a permanent solution as it could push the problem underground. 

Option Explicit

To generate more clues you could add Option Explicit.  This forces you to declare all your variables.  My idea is that if you then get a new error it could be a spelling mistake in one of your variables.

Error Handling Routines

Creating error handling routines is a specialist and time consuming task.  All production script should contain code to handle predictable problems such as the server with network share being unavailable.  Even if you want a quick fix to your script, error handling routines can provide extra clues.  What makes error handling code difficult is that you need so many skills; in addition to VBScript, you need to master the logic of ‘If … then … else End If’ statements.

Guy Recommends:  SolarWinds’ Free Bulk Import ToolFree Download Solarwinds Bulk Import Tool

Import users from a spreadsheet.  Just provide a list of the users with their fields in the top row, and save as .csv file.  Then launch this FREE utility and match your fields with AD’s attributes, click and import the users.

Optionally, you can provide the name of the OU where the new accounts will be born. Download your FREE bulk import tool.

If you need more comprehensive software, download a free trial of SAM (Server & Application Monitor)

Seven General Troubleshooting Strategies for 800 Errors

  1. Golden Rule – Break Your Script into Sections

  2. Play the Numbers Game

  3. Try a Walk-Through

  4. If You Are Still Stuck Try a Parallel Approach

  5. Change of Scenery

  6. Avoid ‘Over-think’

  7. Find a Sounding Board

Here are the main categories of error message:

Code 80005xxx – ADSI errors

Errors beginning with 80005xxx mean an ADSI error.  The situation is that you are using the LDAP properties of an object, such as a user and there is a mistake in the name of the attribute.  For example, you script ‘Surname’ when you should call it ‘SN’.  Another common mistake is thinking that DC=Yourdomain means domain controller, whereas it means domain context.  What this means is use your fully qualified domain name and not the name of your domain controller.

Code 8007xxxx – Operating System error e.g. Windows 2008 / Vista

The 8007xxxx family of errors point to a factor outside your VBScript.  Pay close attention to what the the Error: line is telling you.  For example, Error: The network name cannot be found.  If necessary, test the name of your share or printer with a ‘Net View’ command.

Code 800Axxxx  Syntax errors

There are 53 syntax errors all beginning with 800Axxxx.  Carefully check the Error : line for more information on the punctuation error in your VBScript.  In most cases these 800A syntax errors are the easiest to solve because they give meaningful messages, even the Char: number is useful.

Solarwinds Free WMI MonitorGuy Recommends: WMI Monitor and It’s Free!

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.

Download your free copy of WMI Monitor

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