Method:  WshNetwork.MapNetworkDrive

WshNetwork.MapNetworkDrive strLocalName, strRemoteName [,bUpdateProfile] [,strUser] [,strPassword]

The MapNetworkDrive method maps a remote share point specified by strRemoteName to a local drive letter specified by strLocalName. If the optional parameter bUpdateProfile is set to True (default is False), the mapping will be saved to the current user's profile. The parameters strUser and strPassword can be used to connect to remote drives using someone else's credentials.

The following VBScript code maps the remote share point \\Server\PublicFiles to local drive letter Z:

Code:
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "Z:", "\\Server\PublicFiles"



Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information