Network - Map network drive

 

Declaration

<AMNETWORK ACTIVITY="connect_specific_user" DRIVELETTER="text" NETPATH="text" USERNAME="text" PASSWORD="text (options)" />

Related Topics  

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 because 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 (i.e. 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). This is a visual mode parameter used only during design-time, therefore, contains no markup.

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.

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

Connect "\\serverName\sharedResourceName\folderName" to "M:".

Copy
<AMNETWORK ACTIVITY="connect_specific_user" DRIVELETTER="M:" NETPATH="\\serverName\sharedResourceName\folderName" RECONNECT="YES" />