From http://technet.microsoft.com/en-us/library/ee624057(WS.10).aspx
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.
Base Parameters | Description |
---|---|
/dl | Deletes the local printer. |
/dn | Deletes a network printer connection. |
/dd | Deletes a printer driver. |
/e | Displays the printing preferences for a given printer. |
/ga | Adds a per computer printer connection (the connection is available to any user on that computer when they log on). |
/ge | Displays per computer printer connections on a computer. |
/gd | Deletes a per computer printer connection (the connection is deleted the next time a user logs on). |
/ia | Installs a printer driver by using an .inf file. |
/id | Installs a printer driver by using the Add Printer Driver Wizard. |
/if | Installs a printer by using an .inf file. |
/ii | Installs a printer by using the Add Printer wizard with an .inf file. |
/il | Installs a printer by using the Add Printer wizard. |
/in | Connects to a remote network printer. |
/ip | Installs a printer by using the Network Printer Installation Wizard (available from the user interface from Print Management). |
/k | Prints a test page on a printer. |
/o | Displays the queue for a printer. |
/p | Displays the properties of a printer. When you use this parameter, you must also specify a value for the modification parameter /n[name]. |
/s | 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. |
/Ss | 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:
|
/Sr | 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:
|
/Xg | Retrieves the settings for a printer. |
/Xs | Sets the settings for a printer. |
/y | Sets the printer being installed as the default printer. |
/? | Displays the in-product Help for the command and its associated parameters. |
@[file] | Specifies a command-line argument file and directly inserts the text in that file into the command line. |
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
No comments:
Post a Comment