Computer Performance, Logon Scripts

Code Error 800A000D - Type Mismatch

Troubleshooting Code 800A000D - Type mismatch

Error 800A000D is straightforward to solve.  The secret is to read the Windows Script Error message carefully, then locate the line number with the Type Mismatch.

Introduction to error Code 800A000D

This runtime error, 800A000D occurs when you execute a VBScript.  My suggestion is that there is a VBScript statement that does not understand a keyword you are using in your script.  Alternatively, you may not be running the script as an ordinary user and not as an Administrator.

The Symptoms you get 800A000D Code 800A000D  - Type mismatch ' Join'

The script does not execute as you hoped, instead you get a WSH error message.  One possibility is that you are using a WSH object or method that has been misspelt.

Chuck kindly wrote in saying that another cause maybe that you are logged on as ordinary user, and not an Administrator.

The Cause of Code 800A000D

Your VBScript contains an illegal method, probably due to a typing mistake, an extra letter.  Look for a clue opposite the phrase Error: Type mismatch....  In particular, double check the spelling of your objects.

Note 1:  Source: Microsoft VBScript runtime error.  This is not a syntax error in the sense of a missing bracket, more a typo in the keyword mentioned in the Error: line of your WSH Message.

Note 2:  Error: Type mismatch: 'Join'.  Chuck says this could mean that you are logged on as an ordinary user and not an administrator.

Note 3: What I have found, is that there need not be any errors per say in the script in order to receive the type mismatch join error. But what the cause has been for two of my recent experiences, is that the user in question, is only a part of a single group that isn’t

1. A domain built-in group.
2. Query based distribution groups.

The join statement fails in this case because the CurrentUser.MemberOf only contains a single value so when it tries to append the next value, there is no array for it to search through. One fix would be to add error handling around this statement, so that if it fails, it runs the same line except without the join statement. The other option is of course to ensure your users are a part of more than one security or static distribution group. I haven’t experimented with whether local domain, global or universal have an effect on this either, but I would imagine not.
Nathan Bicknell

The Solution

Check the spelling of your variables and methods.  Look for clues particularly the Line: number and check the Char: references.  In the example it is Line: 14  Char: 1.  In this instance the:  'Error: Type mismatch: 'CreateeObject'' tells us where the mistake is to be found. 

In the case of runtime errors you can use this work around.  Add this line: On Error Resume Next.  A better technique would have to employ error correcting code.

Try logging on as an Administrator, especially if your error says: Error: Type mismatch: 'Join'.  (My screen shot says Error: Type mismatch: 'CreateeObject' - clearly my error is a typo.  CreateObject.

If you are still stuck then a good script editor really would help this type of problem because it color codes the commands.  Free download of OnScript.

Example 1 of Error 800A000D Script

Error: CreateeObject- Extra letter e.  Look on line 14.

Correction: CreateObject - Corrected, letter e removed

 

' MapNetworkDrive.vbs
' VBScript Error 800A000D to map a network drive.
' Author Guy Thomas http://computerperformance.co.uk/
' Version 2.2 - April 24th 2005
' --------------------------------------------------------'
Dim objNetwork
Dim strDriveLetter, strRemotePath
strDriveLetter = "J:"
strRemotePath = "\\alan\home"

' Purpose of script to create a network object. (objNetwork)
' Then to apply the MapNetworkDrive method. Result J: drive
Set objNetwork = CreateeObject("WScript.Network")

objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
WScript.Quit

' End of Example Error 800A000D VBScript.
 

Example 2 of Error 800A000D ScriptError 800A000D Script Type mismatch

In this example, the WSH message displays not only the line number but also the error string.

On this occasion, the fault is a $ (dollar) where VBScript expects an & (ampersand).

Actually, there is another mistake in line 10 it should be:
Set objRootDSE = GetObject("LDAP://"& strServer & " RootDSE")

Note the position of the two sets of speech marks.

 

' BindADUser.vbs
' VBScript to bind to AD and create a user in Users Container.
' Author Guy Thomas http://computerperformance.co.uk
' Version 2.3 - March 7th 2004
' -----------------------------------------------------------------'
Option Explicit
Dim objDomain, objUser, objRootDSE, strServer
strServer = "Alan"
Dim objContainer, strDNSDomain
Set objRootDSE = GetObject("LDAP://& strServer $ "/" $ RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
strDNSDomain = "OU=Accounts," & strDNSDomain
Set objDomain = GetObject("LDAP://" & strDNSDomain)
Set objUser = objDomain.Create("User", "cn=Guido 4Fawkes")
objUser.Put "sAMAccountName", "GuidoFawkes4"
objUser.SetInfo
WScript.Echo "Created " & objUser.get ("cn")
WScript.quit
' End of Script
 

 

Example 3 of Type Mismatch

strNewXP = strNewXP + intComputerNum
 

To join the two variables, I should have used was ampersand (&) not plus (+)

Solution

strNewXP = strNewXP & intComputerNum

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.