MORE INFORMATION
The following examples list the most typical uses for the
Printer User Interface (PrintUIEntry) command.
Note This command runs only on a Windows XP or Windows 2000-based
computer; and it can be used only to install a printer on, or remove a printer
from, a Windows XP, Windows 2000, or Windows NT 4.0-based server or
workstation.
The following example adds an Agfa printer driver and
creates a logical printer on a computer named SERVER.
Note Both lines can be placed in a batch file or typed after each
other at a command prompt. These two lines are wrapped for readability.
rundll32 printui.dll,PrintUIEntry /ia /c\\server /m "AGFA-AccuSet v52.3" /h
"Intel" /v "Windows 2000" /f %windir%\inf\ntprint.inf
rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /c\\SERVER /f
"%windir%\inf\ntprint.inf" /r "lpt1:" /m "AGFA-AccuSet v52.3"
The following example deletes an Agfa printer on a computer named
SERVER:
rundll32 printui.dll,PrintUIEntry /dl /n "Test Printer" /c\\SERVER
For more information about the available switches, type
/? after the command.
Additionally, type the
following at a command prompt:
rundll32 printui.dll,PrintUIEntry /?
The preceding command displays the full list of usage switches, with
extensive examples for using this method.
Note The following sample syntax works correctly as long as the
standard TCP/IP ports are created:
rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /f
%windir%\inf\ntprint.inf /r "IP_157.57.50.98" /m "HP Laserjet 4000 Series PCL" /Z
If you do not enter the printer name correctly, or if you specify a
printer that is not connected to the server, standard TCP/IP ports are not
created, and you may receive the following error message:
Printer User Interface
Printer rundll command failed.
Command: /if /b "Test Printer" /f %windir%\inf\ntprint.inf /r "IP_157.57.50.98"
/m "HP Laserjet 4000 Series PCL" /Z.
You either entered a printer
name that was incorrect or the specified printer is no longer connected to the
server. Click Help for more information.
Sample of How to Add an IPP Printer
rundll32 printui.dll,PrintUIEntry /b "DisplayPrinterName on http" /x /n "part of the n switch" /if /f %windir%\inf\ntprint.inf /r "http://hostname/printers/sharename/.printer" /m "HP Laserjet 4000 Series PCL"
Note The
/x switch is not documented with
/?. The
/x switch expects
/n even though it is not used. Also, you may be using a printer
other than the HP Laserjet 4000 Series PCL. The
/x flag treats the install as a "Web point and print." This flag
indicates that the printer is a masquerading (masq) printer. A masq printer is
partly local printer and partly a network printer. A masq printer receives rich
notifications from the remote print server. Without the
/x option, the printer is a local printer with a redirected port. It
works fine, but it has very limited notifications.
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.