.AddPrinterConnection

Add a printer connection.

Syntax 
      objNetwork.AddPrinterConnection(strLocalName, 
                     strRemoteName[,bUpdateProfile][,strUser][,strPassword]

Key
   objNetwork    : A WScript.network object

   strLocalName  : Local printer Name (String value) 
   
   strRemoteName : Remote printer Name (String value) 

   
   bUpdateProfile : Indicate whether the printer mapping 
                    is stored in the current user's profile.
                    Boolean value  
                    If TRUE the mapping is stored in the user profile. 
                    default = false.
   
   strUser       : The user name. (if using a different profile)
                   Optional. 
   
   strPassword   : The user password. (if using a different profile)
                   Optional. 
   
Example
' Connect a network printer to LPT1.

Set objNetwork = WScript.CreateObject("WScript.Network") 
objNetwork.AddPrinterConnection "LPT1", "\\Server\Print1"

The AddPrinterConnection method adds a network printer to an MS-DOS printer port, such as LPT1.
To add a remote Windows-based printer connection, use the AddWindowsPrinterConnection method.

“Modern art is what happens when painters stop-looking at girls and persuade themselves that they have a better idea” ~ John Ciardi

Related:
Add Network printer - .AddWindowsPrinterConnection
printcon.vbs - change a Print connection to a different Queue/Server
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
PRNMNGR - Add, delete, or list printers / connections, set the default printer
Network Printing - Advice & Tips


© Copyright SS64.com 1999-2014
Some rights reserved