Maps a network drive.
DriveMapAdd( "device", "remote share" [, flags [, "user" [, "password"]]] )
Parameters
device | The device to map, for example "O:" or "LPT1:". If you pass a blank string for this parameter a connection is made but not mapped to a specific drive. If you specify "*" an unused drive letter will be automatically selected. |
remote share | The remote share to connect to in the form "\\server\share". |
flags | [optional] A combination of the following: 0 = default 1 = Persistant mapping 8 = Show authentication dialog if required |
user | [optional] The username to use to connect. In the form "username" or "domain\username". |
password | [optional] The password to use to connect. |
Return Value
Success: | Returns 1. (See Remarks) |
Failure: | Returns 0 if a new mapping could not be created and sets @error (see below). (See Remarks) |
Remarks
When the function fails (returns 0) @error contains extended information:
Related
DriveMapDel, DriveMapGet
Example
; Map X drive to \\myserver\stuff using current user
DriveMapAdd("X:", "\\myserver\stuff")
; Map X drive to \\myserver2\stuff2 using the user "jon" from "domainx" with password "tickle"
DriveMapAdd("X:", "\\myserver2\stuff2", 0, "domainx\jon", "tickle")