Skip to content

Installing printers using a batch script

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:
 
Information box containing shitloads of information
 
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.

2 Comments

  1. Thomas Diaz Thomas Diaz

    In our company we deploy printers as well as map drives and configure many other users settings with a desktop management system called desktop authority.

    As a good logon script replacement this solution offers a lot for configuring most key areas involved in desktop configuration like outlook profiles, power management settings, software depoyment, usb security, registry settings and many more.

  2. Aleksander R. Rødner Aleksander R. Rødner

    Thank you Thomas, that looks very interesting.

Leave a Reply