This error code, 800A0408 occurs when you execute a VBScript.
A wild guess a problem with an apostrophe, possibly in a 'REM statement.
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
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.
Try
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 (21 day eval).
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.