Network Printer Management from Command Prompt

()

rundll32 printui.dll,PrintUIEntry

printui.dll is an library for automated network printer management tasks with features used by the printer configuration dialog boxes. These features can also be called from a script or command-line batch file, or run interactively through the command prompt.

printui.dll runs with rundll32.exe to provide tools for demanding tasks, add printers, manage, delete, and add network printer connection.

Network Printer Management printui.dll

Open printer server properties

Printer server properties open rundll32 printui.dll,PrintUIEntry /s
Open properties of printer server
Properties of Printer Server Section Drivers

Network printer management use printui.dll Connect to the network printer:

rundll32.exe printui.dll,PrintUIEntry /in /n \\server\LaserJet

The LaserJet network printer which is shared on the SERVER, is installed on the client computer and connected to the server.

Setup printer using driver INF-file:

rundll32 printui.dll,PrintUIEntry /if /b "AddressLabel" /f C:\Driver\Zebra\ZBRN\ZBRN.inf /r "10.10.10.89" /m "ZDesigner GK420t" /Z

/if Installs printer using the specified INF-file
/b Basic printer name AddressLabel
/f Path to the printer driver INF-file
/r Portname or IP address
/m Model name of the printer driver from the INF-file
/Z Share this printer, use only with option “/if”

Delete local printer driver:

rundll32 printui.dll,PrintUIEntry /dd /m "LaserJet" /q

/dd Deletes the local printer driver
/m Model name of the printer driver
/q Do not display possible error messages

Delete network printer connection:

rundll32 printui.dll,PrintUIEntry /dn /n "LaserJet" /q

/dn Deletes the network printer connection.
/n The name of the printer.

  Help on printui.dll is get with the following command in the command prompt.

rundll32 printui.dll,PrintUIEntry /?

Network Printer Management Batch example:

Example add network printer connection using printui.dll run from Loginscript.

@echo off
@REM Batch Network printer connection
if /i %computername:~0,2%==BE goto Bern 
if /i %computername:~0,2%==BS goto Basel
if /i %computername:~0,7%==SPECTRE goto LAPTOP
goto END
:Bern
@REM Network printer connection Bern
rundll32 printui.dll,PrintUIEntry /in /n \\SERVER\LaserJet_BE
goto END
:Basel
@REM Network printer connection Basel
rundll32 printui.dll,PrintUIEntry /in /n \\SERVER\LaserJet_BS
goto END
:LAPTOP
@REM Network printer connection SPECTRE
rundll32 printui.dll,PrintUIEntry /in /n \\SERVER\OfficeJet_HO
goto END
:END

Conclusion

I hope this post can help with network printer management using the printui.dll, a library for automated Windows network printer management tasks with functions used by the printer configuration dialog boxes. These functions are also called from scripts or a command-line batch file, or run interactively from the command prompt.

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply

Your email address will not be published. Required fields are marked *