Microsoft® Windows® Script Host
MapNetworkDrive Method
WSH Reference
Version 1

See Also                      Applies To


Description
Maps the share point specified by strRemoteName to the local resource name strLocalName.
Syntax
object.MapNetworkDrive strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword]
Parameters
Part Description
object WshNetwork object.
strLocalName Local resource name.
strRemoteName Remote share to map.
bUpdateProfile Optional. If bUpdateProfile is supplied and its value is TRUE, the mapping is stored in the user profile. The default is FALSE.
strUser, strPassword Optional. If you are mapping the share point using the credentials of someone other than current user, you can specify strUser and strPassword.
Example
The following example shows how to map the "Z" drive to a network share:
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "Z:", "\\Server\Share"