Print U I Users Guide
Print U I Users Guide
Print U I Users Guide
Abstract
System administrators may automate many printer configuration functions using scripts and printui.dll. Printui.dll
is the executable file containing the functions used by the printer configuration dialogs. These functions may also
be called from within a script, a batch file, or interactively from a command line. This paper describes how the
basic functions provided by printui.dll may be used in common system administration tasks.
Contents
Introduction................................................................................................................................... 1
Common Tasks............................................................................................................................. 2
Add a new printer........................................................................................................................ 2
Delete an existing printer............................................................................................................. 2
Add a per-machine connection.................................................................................................... 2
Remove per-machine connections.............................................................................................. 3
PrintUI.DLL Reference.................................................................................................................. 4
Usage.......................................................................................................................................... 4
Options........................................................................................................................................ 4
PrintUIEntry command options................................................................................................ 4
PrintUIEntry modification options............................................................................................. 5
Related Links................................................................................................................................ 7
Introduction
System administrators may automate many printer configuration functions using scripts and printui.dll.
Printui.dll is the executable file containing the functions used by the printer configuration dialogs. These
functions may also be called from within a script, a command line batch file or run interactively from the
command line.
This paper describes the basic functions provided by printui.dll and how they may be used in common
system administration tasks. The tasks covered in this document are:
Common Tasks
This section presents some of the most common printer configuration tasks and how they can be
automated by calling printui.dll functions from the command line or from a batch file.
When executing the commands shown in the examples below, note that the PrintUIEntry keyword on
the command line is case sensitive, and must be entered with the exact capitalization shown.
When entering the \\machine\printer string you must substitute machine with the correct print server
name and printer with the name of the desired printer hosted on that print server. Run the command on
the machine on which you wish to install or remove the printer.
PrintUI.DLL Reference
This section lists the command line options supported by printui.dll.
Usage
When executing the command shown below note that the PrintUIEntry keyword on the command line
is case sensitive, and must be entered with the exact capitalization shown.
rundll32 printui.dll PrintUIEntry [options] [@commandfile]
Replace [options] in the command line above with one or more of the options described in the
following section or use a command file containing multiple options as desired.
Options
The options listed below are those displayed by executing the following command and reprinted here
for your convenience.
rundll32 printui.dll PrintUIEntry /?
Bold text identifies the rundll32 command line options with the description of the option following in
normal text. Strings delimited by brackets, such as [file] should be replaced as described in the
command description. The string to replace includes the brackets. For example, to use the /n option
used to enter the printer name and described in the text below as:
/n[name] printer name
And your printer was named \\machine\printer, the complete option would be entered as:
/n\\machine\printer
PrintUIEntry command options
These command options determine the function to be performed by the command. Only one of these
options may appear in a command line. The command may be modified by one or more of the
modification options listed below. Note that not all modification options are supported by all command
options.
/? Help this message
/dd delete printer driver
/dl delete local printer
/dn delete network printer connection
/e display printing preferences
/ga add per machine printer connections
/ge enum per machine printer connections
/gd delete per machine printer connections
PRINTER_INFO_2
PRINTER_INFO_7
Color Profile
PrinterData
Security descriptor
Global DevMode
Minimal settings
User DevMode
Force name
Resolve port
Related Links
For the latest information about Windows Server 2003, see the Windows Server 2003 Web site at
http://www.microsoft.com/windowsserver2003.