Computer Performance, Windows 2003, Exchange 2003, 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  80020009 - There is no printer called:

Troubleshooting Error Code 80020009 - There is no printer called:

Introduction to Code Error 80020009 VBScript

This error code, 80020009 usually occurs when you execute a VBScript.  You are probably using a WScript method called SetDefaultPrinter.

The Symptoms You Get Code 80020009 Error VBScript

The script does not set the default printer as you would have hoped.  Instead, you get an Windows Script Host error message, such as the diagram on the right. The probable scenario is that you are trying to create a Windows logon script.

The Cause of Code 80020009

The problem is that you need to map the printer FIRST, only then can you set it as the default.  Note that Source: WSHNetwork.SetDefaultPrinter gives a valuable clue.  Also check the line number of the error (Line: 4).

The Solutions

Include an extra method AddWindowsPrinterConnection  in your script. Look for clues particularly the Line: number and check the Char: references.  In the case of runtime errors, you can use this work around.  Add this line: On Error Resume Next.  However it is much better to try and cure the problem, then just use a work-around.

  ‡

Example of a Code Error 80020009 Script

Part 1

Remember to add the SetDefaultPrinter command after you have first made the printer connection with this code: 

' VBScript.
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\ServerName\PrinterName"

Below is a completed example, however remember that I do not know the name of your server or printer share, so substitute \\ ServerName for the name of a real server.

Part 2

' VBScript.
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\ServerName\PrinterName"

Set net = CreateObject("WScript.Network")
net.SetDefaultPrinter "\\ServerName\PrinterName"

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:

What next? Try my eBook:

 

Download my Logon Script eBook for only $6.25

Logon ScriptThe extra features you get in your eBook include, more pages full of detailed examples.  Also, ten 'how to...' sections, with screen shots showing which menus to use.  Go for Guy's eBook - and get a printable version with copy enabled and no expiry date.

  Jumbo Script 7 Package

See also

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.