Adds a shared network drive to your computer system.
object.MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword])
String value indicating the name by which the mapped drive will be known locally.
String value indicating the share's UNC name (\\xxx\yyy).
Optional. Boolean value indicating whether the mapping information is stored in the current user's profile. If bUpdateProfile is supplied and has a value of true, the mapping is stored in the user profile (the default is false).
Optional. String value indicating the user name. You must supply this argument if you are mapping a network drive using the credentials of someone other than the current user.
Optional. String value indicating the user password. You must supply this argument if you are mapping a network drive using the credentials of someone other than the current user.
An attempt to map a non-shared network drive results in an error.
Legacy Code Example
The following code maps the logical drive "E" to a network share with the UNC name "\\Server\Public."
Dim WshNetwork Set WshNetwork = WScript.CreateObject("WScript.Network") WshNetwork.MapNetworkDrive "E:", "\\Server\Public"
var WshNetwork = WScript.CreateObject("WScript.Network"); WshNetwork.MapNetworkDrive ("E:", "\\\\Server\\Public");