Error code, 800A03FD occurs when you execute a VBScript 'Select' statement. The problem is you are using Select but without the corresponding 'Case' statement. There are two variations of this error:
Example 1 WMI Example 2 Pure Select Case
For both Examples, the Symptoms you get
The script does not execute as you had hoped. Instead. Windows
Scripting host generates a message
box like this picture:
For both Examples the Cause of Code 800A03FD
Your VBScript contain is missing a argument. Source: Microsoft VBScript compilation error, indicates an syntax error in a
statement in your script. Compilation errors such as missing brackets are easy, but problems with Select ... Case are more subtle. For more help let us check is the Line: number, (12 in example 1).
The Solutions
The Windows Scripting Host gives us three useful clues, firstly, look on
Line: 10, do count any remark or empty lines. Secondly, the Char: number
8, is very useful in tracing the error. Thirdly, there is something
wrong with the Select statement, which is confirmed in the message by Error: Expected 'Case'.
The underlying problem is that Select * is inappropriate here. In VBScript 'Select' requires
Case. 'Select * from... WHERE' is an SQL construction that is misused in this example. If you employ Select, then is should be in brackets: (Select * from colaccounts). There should be
no 'Where' clause.
‡
Example 1 of Script showing Error 800A03FD
Check the Select * The problem is that you cannot say where objAccount.name = "Guest".
Try Removing the where statement alltogether.
'VBScript to
Enumerate Accounts, and SID
On Error Resume Next
if Err <> 0 Then
set lasterr = CreateObject("WbemScripting.SWbemLastError")
Wscript.echo lasterr.Operation
End if
set objWMIService = GetObject("Winmgmts:\\" & strComputer)
set colAccounts = objWMIService.InstancesOf("win32_Account")
For each objAccount In colAccounts Select * from colaccounts where objAccount.name = "Guest"
WScript.echo "Name " & objAccount.name & vbCRLf & _
"SID : " & objAccount.SID & vbcrlf & _
"Sid Type : " & objAccount.SIDType & vbcrlf & _
"Status : " & objAccount.Status & vbcrlf & _
"Domain : " & objAccount.Domain & vbcrlf & _
"Caption : " & objAccount.Caption
Next
WScript.quit
Guy Recommends: SolarWinds Engineer's Toolset v10
This Engineer's Toolset v10 provides a comprehensive console of utilities
for troubleshooting computer problems. Guy says it helps me
monitor what's occurring on the network, and each tool teaches me more about how the
underlying system operates.
The problem is here on Line 16: Select objDisk.DriveType
The solution is: Select Case objDisk.DriveType
' SelectCaseDrive.vbs ' Version 1.2 ' Guy Thomas 15th August 2010
Option Explicit
Dim objWMIService, colDisks,
objDisk ' Objects Dim strDriveType, strComputer ' Strings
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery _ ("Select * from Win32_LogicalDisk") For Each objDisk in colDisks Select objDisk.DriveType Case 1 strDriveType = "Drive could not be determined."
Case 2 strDriveType = "Removable Drive (Floppy?)" Case 3 strDriveType = "Local hard disk." Case 4 strDriveType = "Network disk." Case 5 strDriveType = "Compact disk (CD)" Case 6 strDriveType =
"RAM disk." Case Else strDriveType = "Drive type Problem." End Select Wscript.Echo "Device ID = " & objDisk.DeviceID &vbCr _ & "Drive Type : " & strDriveType Next
Guy
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.
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.