Skip to content

Net_MapNetworkDrive

Maps a network drive for the account that runs the script. Use the function in a user (US) job, so the drive is mapped for the logged-on user.

What happens depends on the drive letter:

Drive letter Result
Not in use The drive is mapped.
Mapped to another share The existing mapping is always disconnected, and the drive is mapped to sServerShare.
Already mapped to sServerShare If bDisconnectExisting is TRUE, the drive is disconnected and mapped again. If it’s FALSE, nothing changes and the function returns TRUE.

Use Domain\UserName if you wish to map a drive using another User.
Using * as password, the CapaInstaller reads and decrypts the password if it has been encrypted using CapaInstaller.
See more about the password encryption feature Using passwords in CapaInstaller VB Scripting Library

Net_MapNetworkDrive(sDrive, sServerShare, bDisconnectExisting, sUserName, sPassword) As Boolean

Drive letter to map, including the colon, for example Q:

UNC path to map

Disconnect and map the drive again if it’s already mapped to sServerShare

Username. Use if you must connect with another user

Password for the user. Use * if the password is encrypted by CapaInstaller in registry

If bStatus Then bStatus = Net_MapNetworkDrive("Q:", "\\CAPAINSTALLER\PRINTERSHARE", True, "", "")

Scripting Guidelines

Net_RemoveNetworkDrive Net_EnumNetworkDrives Net_EnumNetworkDrivePaths Constants Package Property Variables