Adds a remote MS-DOS-based printer connection to your computer system.
object.AddPrinterConnection(strLocalName, strRemoteName[,bUpdateProfile][,strUser][,strPassword])
The AddPrinterConnection method adds a network printer to an MS-DOS printer port, such as LPT1. You cannot use this method to add a remote Windows-based printer connection. To add a remote Windows-based printer connection, use the AddWindowsPrinterConnection method.
The following code uses the AddPrinterConnection method to connect a network printer to LPT1.
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.AddPrinterConnection
"LPT1", "\\Server\Print1"
var WshNetwork = WScript.CreateObject("WScript.Network");
WshNetwork.AddPrinterConnection
("LPT1", "\\\\Server\\Print1");
WshNetwork Object | AddWindowsPrinterConnection Method | EnumPrinterConnections Method | RemovePrinterConnection Method | SetDefaultPrinter Method