Network - Map network drive
Declaration
<AMNETWORK ACTIVITY="connect_specific_user" DRIVELETTER="text" NETPATH="text" USERNAME="text" PASSWORD="text (options)" />
Description
Connects a drive letter to a network path or disconnects a currently connected drive from a network path.
NOTE: This activity cannot be
executed when the machine is in a logged off state as mapped
drives are only available when a user is logged on.
Practical usage
Used to map a network share to a drive letter. Some networks may require a network username and/or password with which to connect.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Drive letter | Text | Yes | Z: | DRIVELETTER="X:" | The letter to represent the mapped drive. The drive letter should always be followed by a colon symbol (for example, X:). |
Network path | Text | Yes | (Empty) | NETPATH="\\Server1\Sharename" | The Universal Naming Convention (UNC) path to the network share that should be mapped (UNC path example: \\server-name\shared-resource-path-name). |
Reconnect at logon | Yes/No | No | No | RECONNECT="YES" | If selected, specifies that drive mapping will be re-established at logon. Disabled by default. |
Connect using different user | --- | --- | --- | --- | If
enabled, specifies that drive mapping should be established using
the credentials of a user other than the one currently logged
on (disabled by default). NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes. |
Username | Text | No | (Empty) | USERNAME="MyUserName" | A valid network username that has access to map the selected share. This parameter is available only if the Connect using different user parameter is set enabled. |
Password | Text | No | (Empty) | PASSWORD="encrypted" | A valid password for the user account specified in the Username parameter. This parameter is available only if the Connect using different user parameter is set enabled. |
Example
NOTE:
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task maps a network drive.
Copy
<AMNETWORK ACTIVITY="connect_specific_user" DRIVELETTER="M:" NETPATH="\\serverName\sharedResourceName\folderName" RECONNECT="YES" />