Since we have quite a few users who use different printers (some of them as young as 5) I thought it would nice to automatically setup their default to be the closest printer to them.

In Windows XP it works great, no error messages. In Windows 2000 I get an error saying there is no such printer. I know the printer exists for that account and when I open the printers folder the printer is there and it is set as the default (meaning the code worked). From what I tell the code executed before the printers loaded and caused the error. Are there any scripts to hide error messages in vbs? Or does anyone have another solution I could implment?

I've tried a time delay script but as I thought it held up the rest of the computer's boot sequence as well.

Spiceuser's method would probably be the most efficient way to do what you want to do. you generally can't go wrong with his advice.

@spiceuser aka Barney

as stated in the linked thread you should probably make a howto. It would save you from having to retype all that info.

and just FYI in the thread you linked to you note the place to drop the vbs as c:\documents and settings\all users\start menu\ which may be why it didn't work for those people cause they didn't realize they were supposed to put it in the startup folder in the start menu. they just ended up with a start menu shortcut that did them no good.

User: "why is this shorcut here in my start menu? what is vbs? I will call the tech department."

Ring....

IT Guy*: Tech Department what's your problem?

User: The website is down

*Guy is assumed as whoever is answering the phone this could also be a female. I was not implying that men are the only ones that work in tech.

I've read (top to bottom, and really close) your description and I've seen the script. I just want to make sure I understand one thing before I start implimenting. From the script I see it adds a number of network printers and then sets one as the default. So, a user logs on and the script maps the 7 printers they can use and then sets the default to the printer I'd like them to use. They log off and go to another computer and log on. The script runs again and adds the same 7 network printers and sets another as default from what I can gather. Will Windows, upon seeing the printers in the script are already there, skip the add printers part and simply assign a new default?
I hope my explanation is clear. Thanks for your help.

I'm no scripting expert but I'm guessing it will still try to run each again regardless if it's already installed or not.

It won't be the same 7 printers if the script you have is different. I have about 12 different scripts for my different departments and offices. If someone in accounting goes upstairs and logs into the marketing machine, the script doesn't follow the user. That's b/c the script is static to each computer by using the all users startup directory. So they'll get the nearest printer set as default as indicated by whichever department's script is being called on. The key to keeping it easy to administer is that you don't place the actual vbs script in the startup directory; just a shortcut to that actual script. Then you only have to change a script one time and everyone pointing to it gets any changes.

This will make sure the printer you were looking for is installed on the machine. If it's not, then it wont error. In addition, if you're looking to troubleshoot. You could output the objPrinter in colInstalledPrinters to a message box to see what the names are.

We're not using any static IPs or ranges for departments. We have roaming profiles and so the installed network printers follow students wherever they go. That's why I asked spiceuser about the script trying to reinstall printers that were already there. I'm going to setup and test out the script today.

We've written a script here to define network printers to uses and the only think I found we had to do was give a:

wscript.sleep 3500

This is due to the fact that a PC has to load the Printer and the drivers which takes a few seconds. Once we instated a pause before setting the default printer, this started to work without the error:

The scipt snip i posted will allow you to test to see if the printer got installed. It's essentially the same thing as you posted in your original post Nate, except it tests before it assigns the default.

You could: test, wait, test, if not found, then reinstall, wait, test, assign.

Here's a question I have, I'll probably be asked to put this in a different thread, I've been able to setup network printers using a combo of User OU, Computer Naming Convention (Patterns to identify where and what printers to add i.e.: XXX-Room-YYY), and Delete these printers at log off of the comptuer.

All with the Use of VBScripts (Ya Hoo!)

(If anyone wants to know or see the script let me know)

I have one question, I 've searched the net for, and got tired of looking for, a way to delete local printers with exceptions (We'd like to Keep the Cute PDF Printer).