This article was been published more than a year ago. The information may be outdated.
Part of my job is installing printers for users. Now, I could just go on mapping the printserver and finding the printer from there, but that takes a lot of time, as we have some 100 plus printers per printserver. Instead, I spent an hour creating batch scripts, and have since used them to install printers.
The command we need is an extension of the
rundll32 command. The basic command is this:
rundll32 printui.dll,PrintUIEntry. Now, just this will not really help you. You need to define some switches and operators. First off, you might want to know what switches and operators are available to you. To find them, simply open the “run” dialog box, and enter the command
rundll32 printui.dll,PrintUIEntry /?. This will yield an information box looking something like this:
The command I usually use looks something like this:
rundll32 printui.dll,PrintUIEntry /in /q /n "\\PRINTSERVER\PRINTER"
The switches I use are:
/in – Adds a network printer connection
/q – Runs in quiet mode
/n – Defines what printer to add
There are many possibilities with this script, and I have never seen it fail.