Using PrintUI.dll to Redirect a Printer

You can use PrintUI.dll from a command line to manage and change printer settings. The most common place I use it is in a scheduled task to redirect print jobs. 

rundll32 printui.dll,PrintUIEntry /Xs /n “Name” PortName “IP_192.168.3.1”

The /Xs tells it to set printer options, /n “Name” specifies the name of the printer as it appears in Windows, and PortName “IP_192.168.3.1” is specifiying the new port for the printer to use.  Setting the printer back to normal is as easy as changing the PortName to the original port.  You can put these commands in a batch file and set it as a scheduled task to redirect a primary printer when some other application will have dedicated access to it.

There are many more options and settings you can adjust with PrintUI, and you can get all the documentation on it from Microsoft.