Updated: April 17, 2012
Applies To: Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows Server 2012, Windows 8
Automates many printer configuration tasks. Printui.dll is the executable file that contains the functions used by the printer configuration dialog boxes. These functions can also be called from within a script or a command-line batch file, or they can be run interactively from the command prompt. For examples of how this command can be used, see Examples.
rundll32 printui.dll PrintUIEntry [BaseParameter] [ModificationParameter1] [ModificationParameter2] [ModificationParameterN]
You can also use the following alternate syntaxes, although the examples in this topic use the previous syntax:
rundll32 printui.dll,PrintUIEntry [BaseParameter] [ModificationParameter1] [ModificationParameter2] [ModificationParameterN]
rundll32 printui PrintUIEntry [BaseParameter] [ModificationParameter1] [ModificationParameter2] [ModificationParameterN]
rundll32 printui,PrintUIEntry [BaseParameter] [ModificationParameter1] [ModificationParameter2] [ModificationParameterN]
There are two types of parameters: base parameters and modification parameters. Base parameters specify the function that the command is to perform. Only one of these parameters can appear in a given command line. Then, you can modify the base parameter by using one or more of the modification parameters if they are applicable to the base parameter (not all modification parameters are supported by all base parameters).
Deletes the local printer.
Deletes a network printer connection.
Deletes a printer driver.
Displays the printing preferences for a given printer.
Adds a per computer printer connection (the connection is available to any user on that computer when they log on).
Displays per computer printer connections on a computer.
Deletes a per computer printer connection (the connection is deleted the next time a user logs on).
Installs a printer driver by using an .inf file.
Installs a printer driver by using the Add Printer Driver Wizard.
Installs a printer by using an .inf file.
Installs a printer by using the Add Printer wizard with an .inf file.
Installs a printer by using the Add Printer wizard.
Connects to a remote network printer.
Installs a printer by using the Network Printer Installation Wizard (available from the user interface from Print Management).
Prints a test page on a printer.
Displays the queue for a printer.
Displays the properties of a printer. When you use this parameter, you must also specify a value for the modification parameter /n[name].
Displays the properties of a print server. If you want to view the local print server, you do not need to use a modification parameter. However, if you want to view a remote print server, you must specify the /c[name] modification parameter.
Specifies what type of information for a printer will be stored. If none of the values for /Ss are specified, the default behavior is as if all of them were specified. Use this base parameter with the following values placed at the end of the command line:
Specifies what information about a printer is restored and how conflicts in settings are handled. Use with the following values placed at the end of the command line:
Retrieves the settings for a printer.
Sets the settings for a printer.
Sets the printer being installed as the default printer.
Displays the in-product Help for the command and its associated parameters.
Specifies a command-line argument file and directly inserts the text in that file into the command line.
Specifies the binary file name.
Specifies the base printer name.
Specifies the computer name if the action to be performed is on a remote computer.
Species the Universal Naming Convention (UNC) path and name of the .inf file name or the output file name, depending on the task that you are performing. Use /F[file] to specify a dependent .inf file.
Specifies the UNC path and name of a .inf file that the .inf file specified with /f[file] depends on.
Specifies the driver architecture. Use one of the following: x86, x64, or Itanium.
Specifies the print provider name.
Specifies the UNC path where the printer driver files that you are using are located.
Specifies the driver model name. (This value can be specified in the .inf file.)
Specifies the printer name.
Runs the command with no notifications to the user.
Specifies the port name.
Specifies to use the existing printer driver if it is already installed.
Specifies the zero-based index page to start on.
Specifies the driver version. If you do not also specify a value for /K, you must specify one of the following values: Type 2 - Kernel Mode or Type 3 - User Mode.
Prompts the user for a driver if the driver is not found in the .inf file that is specified by /f.
Specifies that printer names should not be automatically generated.
Specifies to not automatically share the printer being installed.
Changes the meaning of the parameter /h[architecture] to accept 2 in place of x86, 3 in place of x64, or 4 in place of Itanium. It also changes the value of the parameter /v[version] to accept 2 in the place of Type 2 - Kernel Mode and 3 in place of Type 3 - User Mode.
Shares the printer that is being installed. Only use with the /if parameter.
Displays a warning message to the user before committing the changes specified in the command line.
Displays a confirmation message to the user before committing the changes specified in the command line.
Specifies any parameters or options for the Add Printer wizard, the Add Printer Driver Wizard, and the Network Printer Installation Wizard.
r: Enables the wizards to be restarted from the last page.
Specifies global parameters and options that you want to use.
w: Suppresses setup driver warnings to the user.
The PrintUIEntry keyword is case sensitive, and you must enter the syntax for this command with the exact capitalization shown in the examples in this topic.
See Examples in this document for the syntax for some common tasks. For more examples, at a command prompt type: rundll32 printui.dll,PrintUIEntry /?
To add a new remote printer, Printer1, for a computer, Client1, which is visible for the user account where this command is run, type:
rundll32 printui.dll PrintUIEntry /in /n\\client1\printer1
To add a printer using the Add Printer wizard and using an .inf file, InfFile.inf, located on drive c: at InfPath, type:
rundll32 printui.dll PrintUIEntry /ii /f c:\InfPath\InfFile.inf
To delete an existing printer, Printer1, on a computer, Client1, type:
rundll32 printui.dll PrintUIEntry /dn /n\\client1\printer1
To add a per computer printer connection, Printer2, for all users of a computer, Client2, type (the connection will be applied when a user logs on):
rundll32 printui.dll PrintUIEntry /ga /n\\client2\printer2
To delete a per computer printer connection, Printer2, for all users of a computer, Client2, type (the connection will be deleted when a user logs on):
rundll32 printui.dll PrintUIEntry /gd /n\\client2\printer2
To view the properties of the print server, PrintServer1, type:
rundll32 printui.dll PrintUIEntry /s /t1 /c\\printserver1
To view the properties of a printer, Printer3, type:
rundll32 printui.dll PrintUIEntry /p /n\\printer3