CON2PRT.exe (Zero Admin Kit)
Connect or disconnect a Printer
All commands issued using this utility will affect only the user currently
logged in. Con2prt is therefore ideal for managing NETWORK printer connections
when
used in a login script.
Syntax
CON2PRT /f
CON2PRT /c \\PrintServer\PrintShare
CON2PRT /cd \\PrintServer\PrintShare
Key
/f - remove all network printer connections
/c - connect to \\PrintServer\PrintShare
/cd - connect to and set PrintShare as the default printer
Several switches can be combined in one command line. So you can remove all connections before adding new ones all in one command, you can only specify one default printer.
For recent versions of Windows Microsoft now recommend the more flexible RUNDLL32 in preference to con2prt.
The freeware utility AdPrintX is very similar to Con2Prt but has additional functionality, including compatibility with Windows 9x systems. For bulk changes don't miss the Qchange.vbs script.
"I think you know as well as I do what the problem is, Dave. You and
Dr. Poole were planning to disconnect me. I cannot allow this to happen" - HAL
Related:
Qchange.vbs - Change Printer Connection
Network Printing - Advice & Tips including
PRINT - Print a text file
NET VIEW - to view a list of printers
NET PRINT - View and Delete print jobs
PRNCNFG - Display, configure or rename a printer
PRNDRVR - Add, delete or list printer drivers.
PRNJOBS - Pause, resume, cancel, or list print jobs
PRNMNGR - Add, delete, or list printers / connections, set the default printer.
PRNPORT - Create, delete, or list TCP/IP printer ports, change port configuration.
PRNQCTL - Print a test page, pause or resume a printer, clear a printer queue.
RUNDLL32 - Install/Remove Printers (plus advanced
options)
WMIC PRINTER - Set printing options through WMI
WSH:
Add printer - WshNetwork.AddPrinterConnection
WSH: Set default printer - WshNetwork.SetDefaultPrinter
Q314486 - Add Printers with No User Interaction (Win XP)
Equivalent BASH command:
lpc - Line printer control program