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 800A03F4 - Variable is undefined

Troubleshooting Code 800A03F4 - Variable is undefined

Introduction to Code 800A03F4

Error code 800A03F4 occurs when you execute a VBScript.  To be blunt this is due to carelessness.  Either you have not declared a variable at all, or you have misspelt it later in the script.Code 800A03F4 Error: Variable Undefined

The Symptoms You Get

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

The Cause of Error 800A03F4

Code 800A03F4 means that you are using Option Explicit but you have not declared a variable as a Dim Statement in your script.  Note that the Source: is a runtime error (and not compilation error).

The Solution to Variable is undefined

The key to solving error 800A03F4 is reading the reference, 'Error: Variable is undefined: 'xyz'.  In my example 'xyz' is 'numusers'.  You could also double check to see if you are using Option Explicit.  If so, then you need to declare the variable mentioned in the error message.  In my example, Windows Scripting Host is telling us that the problem is at Line: 239, in addition to regular lines, count blank lines and lines with remarks. 

Beware you may, as in my example have correctly declared a similar variable, and all this error is a typo, 'numusers' instead of 'intNumusers'.   My point is that declaring 'numusers', would stop the error message but would result in a faulty script.  Preventing such problems is the reason I have Option Explicit alert me to potential logical errors.

In this case the Char: number (1), may not be the place on the line where the variable is found, so check the whole line.

  ‡

Example of Error 800A03F4 Script

You can see Dim statements at the beginning of the script, also observe that Option Explicit is set at the beginning of the script.

 

Option Explicit

' Objects
Dim objRootDSE, objTrans, objFSO, objShell
Dim objExcel, objSheet
Dim objUser, objGroup, objContainer

Dim intNumusers

 

 

Then go to line 239 and see the variable numusers, this is the root cause of the problem.  The solution is, either  declare this variable at the start or, as it is a typo, alter numusers to intNumusers

'.....Cut to line line 231

231  End If
232  ' Increment to next user.
233  intRow = intRow + 1
234  intNumusers = intNumusers + 1
235

236  Loop
237
238  ' Popup message to finish
239  Wscript.Echo "Number of users created = " & numusers
 

 

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.