WshNetwork.AddPrinterConnection
The AddPrinterConnection method maps the remote printer specified by strRemoteName to the local resource name strLocalName.
Syntax
WshNetwork.AddPrinterConnection strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword]
Parameters
-
strLocalName
-
Local resource to map to.
-
strRemoteName
-
Remote printer to map.
-
bUpdateProfile
-
If bUpdateProfile is supplied and its value is TRUE, this mapping is stored in the user profile.
-
strUser
-
If you are mapping a remote printer using the credentials of someone other than current user, you can specify strUser and strPassword.
-
strPassword
-
If you are mapping a remote printer using the credentials of someone other than current user, you can specify strUser and strPassword.
Example
Set WshNetwork = Wscript.CreateObject("Wscript.Network")
WshNetwork.AddPrinterConnection "LPT1", "\\Server\Print1"