Could we help you? Please click the banners. We are young and desperately need the money
The goal: In a Windows Client-/Server environment you will most probably want to connect printers via logon script(s) and thus be able to assign dedicated printers to clients automatically.
Shell command for defining a default printer:
rundll32 printui.dll,PrintUIEntry /y /n PRINTERNAME
Hint: The printer name equals to the full name of the printer that was assigned in the control panel->printers. Perhaps you'll need to set this name in between of two ".
In order to assign a network printer to a client use the whole UNC path to that printer as PRINTERNAME
rundll32 printui.dll,PrintUIEntry /y /n \\PRINTSERVER\DRUCKERNAME
This might be useful if you want to connect alternative printers for different users:
@echo off IF %USERNAME%==USER1 ( rundll32 printui.dll,PrintUIEntry /y /n PRINTER1 ) IF %USERNAME%==USER2 ( rundll32 printui.dll,PrintUIEntry /y /n PRINTER2 )