Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
All Properties
Method: WshNetwork.AddPrinterConnection
WshNetwork.
AddPrinterConnection
strLocalName, strRemoteName [,bUpdateProfile] [,strUser] [,strPassword]
The
AddPrinterConnection
method maps a remote printer specified by
strRemoteName
to the local resource name
strLocalName
. If the optional parameter
bUpdateProfile
is set to True (default is False), the mapping will be saved to current user's profile. The parameters
strUser
and
strPassword
can be used to connect to remote printers using someone else's credentials.
The following VBScript code connects the network printer \\Server\LaserJet to LPT1.
Code:
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddPrinterConnection "LPT1", "\\Server\LaserJet"
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information