Computer Performance, Logon Scripts

Code  Error 800A0408 - Invalid Character

Troubleshooting Code 800A0408 - Invalid Character

Introduction to Code 800A0408

This error code, 800A0408 occurs when you execute a VBScript.  A wild guess a problem with an apostrophe, possibly in a 'REM statement.Code  Error 800A0408 - Invalid Character

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 800A0408

Your VBScript contains an illegal character, often at the beginning of a line.  It can happen if you copy the script from word, then paste into notepad.  For example, to 'Rem out a line we need the apostrophe, which is ASCII character 39; however if you paste from word you may get ASCII 96 (Grave accent).

Note the clue Source: Microsoft VBScript compilation error, this means a syntax error in your script.

The Solutions

Check the punctuation marks in your VBScript, particularly look out for apostrophes and commas that do not display correctly.  The reference to Line: 1 Char 1, means that the very first symbol that is probably wrong.

Example 1 of error code 800A0408 - Invalid Character

Note: The error  Rem VBScript

It should be ' Rem VBScript
 

Rem VBScript
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set AllDrives = WshNetwork.EnumNetworkDrives()

DriveLetter = "N:" 'must be capitalized
RemotePath = "\\alan\home"

AlreadyConnected = False
For i = 0 To AllDrives.Count - 1 Step 2
If AllDrives.Item(i) = DriveLetter Then AlreadyConnected = True
Next

If AlreadyConnected = False then
WShNetwork.MapNetworkDrive DriveLetter, RemotePath
WshShell.PopUp "Drive " & DriveLetter & " connected successfully."

Else
WShNetwork.RemoveNetworkDrive DriveLetter
WshShell.PopUp "Drive " & DriveLetter & " disconnected."
End if
 

 

 

Example 2 Code 800A0408 - Invalid Character

I include this screen shot just to emphasise that Char: number need not be one.  Thus Char: 20, or what ever your char number is, becomes a big clue in tracing obscure characters that may have sneaked into your script.

Code 800A0408 - Invalid Character

Solarwinds IpMonitorTry a different solution, download SolarWinds ipMonitor

Here is my thinking, ipMonitor will give you valuable data about your network and servers.  This extra information just may unlock the solution to your error code.  One more thing, sometimes when troubleshooting you go around in circles; therefore if you try a different, but related approach, you may just crack the problem.  Free Download of SolarWinds ipMonitor

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 need extra help?

For interpreting the WSH messages check Diagnose 800 errors.

For general advice try my 7 Troubleshooting techniques

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:

 

 *


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.