Computer Performance, Logon Scripts

Guy recommends :
Free Solarwinds
VM Console

Solarwinds VM Console Free Download

Find out which of your VMs are a waste of space and which VMs need more resources.


Guy's Review of
Computer Utilities

 1) FreePing
 2) Engineer's Toolset
 3) Xobni
 4) PuTTY
 5) WMI Monitor
 6) BgInfo
 7) Net-SNMP
 8) IP Address Tracker
 9) DNS Stuff
10) WinDiff Compare


Code Error 800A03F2 - Expected Identifier

Troubleshooting Code 800A03F2 - Expected Identifier

Introduction to Code 800A03F2

When you get Error code 800A03F2 concentrate on the Line: number and especially the Char: number.   Once you trace the line and position, you should be able to identify the problem. A wild guess is there is an extra full stop.Code 800A03F2 Expected Identifier

The Symptoms You Get

The script does not execute as you hoped, instead you get a WSH error message.

The Cause of Error 800A03F2

Your VBScript contain is missing a character.   Note: the clue 'Source: Microsoft VBScript compilation error'.  My point is that 'compilation error' and not a 'runtime error', means this is a syntax error in your script.

Another cause is because VBS does not support the Optional statement for Subs and Functions.  See example 3.

The Solution to Expected Identifier

This is a syntax error, therefore check for a missing argument.  In my example, Windows Scripting Host is telling us that the problem is at Line: 3, count blank lines and lines with remarks.  In this case the Char: number (73), is very useful in tracing the error.  Something is wrong with the syntax at the end of the line 3.

  ‡

Example 1 of Code 800A03F2 error

Note: The Line: 6 Char 34 , .T.)

It should be , True)

DIM fso, gf
Set fso = CreateObject("Scripting.FileSystemObject")
Set gf = fso.CreateTextfile("e:\Ezine\Scripts\ezine12\guyfileb.txt", .T.)
gf.WriteLine("hello guy 1, 2, 3.")
gf.WriteBlankLines 2
gf.Write ("This is a test.")
gf.Close
 

Example 2 of Code 800A03F2 error

WScript.Echo strDriveLetter & " drive is mapped to " & strUncPath.

Here is the tiniest of errors, an unwanted full stop (period) after strUncPath.

 

' BudgetPear.vbs
' Script to map the Budget share on the server pear
' Version 1.1 August 2010
' Guy Thomas http://computerperformance.co.uk

Option Explicit
Dim objNetwork
Dim strDriveLetter, strUncPath
strDriveLetter = "R:"
strUncPath = "\\alan\backup"


Set objNetwork = CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strUncPath
WScript.Echo strDriveLetter & " drive is mapped to " & strUncPath.
WScript.Quit

' End of Guy's Error 800A03F2  script
 

 

Example 3 Optional Statement Problem

Kindly sent in by Robert Dunham

Here, the 800A03F2 is raised because VBS does not support the Optional statement for Subs and Functions and was expecting a valid variable name. Here's the code sample:

 

Call echoComment
Sub echoComment(Optional strComment = "")
If strComment <> "" Then Wscript.Echo strComment End Sub
 

 

This error would also be raised for an incorrectly spelled byVal or byRef statement.

While this is very similar to your first example, I wanted to point out that this error can happen during declaration as well. The above example would be very common for those who are used to standard VB programming.

Guy Recommends: WMI Monitor and It's Free!Solarwinds WMI Monitor

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 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:

 

If you like this page then please share it with your friends

 


 *


Custom Search

Solarwinds Network Device MonitorSolarwinds' Free Network Device Monitor

Thus utility makes it easy to check the health of a router or firewall.  Check the real-time performance and availability statistics for any device on your network.

Get started with an extensive collection of "out-of-the-box" monitors for popular network devices.  Download your free Network Device Monitor

 

Home Copyright © 1999-2012 Computer Performance LTD All rights reserved

Please report a broken link, or an error.