Mapping Printers

by Mar 23, 2012

To map a network printer to a user profile, here's a powerful low level command:

rundll32 printui.dll,PrintUIEntry /in /n "\\pntsrv1\HP552"

This will map the printer share and also install drivers if required. A dialog window outputs progress information (unless you also add the switch /q for "quiet operation").

This low level DLL can do a lot more. To see all options and also example code, try this:

rundll32 printui.dll,PrintUIEntry /?

Two pitfalls you should know: this command is case-sensitive, so "PrintUIEntry" must be spelled exactly like this. And mapping a printer affects the user profile. So if you map a printer while running an elevated shell, the mapping will not be visible to your regular user shell (and vice versa).

Twitter This Tip! ReTweet this Tip!