Managing Printers from the Command Line

Monday, August 18, 2008

I came across this handy way to manage printers from the command line. This makes it really easy to add, delete or change printers from logon scripts and batch files.

rem /y makes printer default

rundll32 printui.dll,PrintUIEntry /in /n file://server/printername
rundll32 printui.dll,PrintUIEntry /in /n
file://server/nextprintername /y

If you're wondering what else you can do with the printui.dll, just enter the following at the command line to bring up the command reference, as shown above:

rundll32 printui.dll,PrintUIEntry /?

Good stuff!