3.12. Mapping a Network Drive
You want to map a drive to a folder on a remote computer.
Using a graphical user interface
Open Windows Explorer.
From the menu, select Tools → Map Network Drive.
Beside Drive, select the drive letter you want to assign.
Beside Folder, enter the UNC path to the network share you want to map.
If you want the drive to be persistent, make sure the box beside Reconnect at logon is checked.
By default, your current credentials will be used to access the network share, if you want to use alternate credentials, click the different username link. Enter a user name and password and click OK.
Using a command-line interface
The following command maps a drive to a network share point:
> net use
The following example maps
\\rtp01\myshare to the N: drive using your
> net use N: \\rtp01\myshare
The following example maps a persistent drive using alternate credentials:
> net use N: \\rtp01\c$ /user:amer\rallen /savecred /persistent:yes
The following command lists all network connections including mapped drives:
> net use
The following command deletes the N: network drive:
> net use N: /delete
' This code creates a mapped drive to a network path. ' ------ SCRIPT CONFIGURATION ------ strDrive = "
<Drive>" ' e.g., N: strPath = "
<Path>" ' e.g., \\rtp01\c$\temp strUser = "
<User>" ' e.g., AMER\rallen strPassword = "
<Password>" boolPersistent = True ' True = Persistent ; False = Not Persistent ' ------ END CONFIGURATION ...