Map Drive Action Icon

Map Drive

Declaration

<AMNETDRIVE ACTION="connect_specific_user" DRIVELETTER="text" NETPATH="text" USERNAME="text" PASSWORD="text (encrypted)" />

See Also

Exchange | Execute Web Service | Get Email | HTTP Get | HTTP Post/Put | Map Drive | MSMQ | Open Web Page | Send E-mail | Send IM | Twitter

Description

Connects a drive letter to a network path or disconnects a currently connected drive from a network path. Some networks require a network user name and password with to connect.

NOTE: This action 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.

Parameters

General Properties

Property

Type

Required

Default

Markup

Description

Option

Text

Yes

Connect

ACTION="disconnect"

Specifies the action that should take place on the drive letter. The available options are:

  • Connect using current user - The network share should be mapped to the drive letter using the credentials of the currently logged on user.

  • Connect using different user - The network share should be mapped to the drive letter using the credentials of a user other than the one currently logged on.

  • Disconnect - The drive letter should be disconnected.

Reconnect at logon

Yes/No

No

No

RECONNECT="YES"

If set to YES, the share should be reconnected when the current user log on. This parameter is available only if the Option parameter is set to Connect using current user.

Drive Letter

Text

Yes

(Empty)

DRIVELETTER="X:"

The drive letter that should be mapped or disconnected depending on the value of the Option parameter. The drive letter should always be followed by a colon (:) symbol (Example: E:)

Network Path

Text

Yes

(Empty)

NETPATH=

"\\Server1\Sharename"

Indicates the Universal Naming Convention (UNC) path to the network share that should be mapped. This option is only valid if the Option parameter is set to Connect using current user or Connect using different user.

UNC Example: \\server-name\shared-resource-path-name

User Name

Text

No

(Empty)

USERNAME="MyUserName"

A valid network user name that has access to map the selected share. This parameter is available only if the Option parameter is set to Connect using different user.

Password

Text

No

(Empty)

PASSWORD="encrypted"

A valid password for the user account specified in the User Name parameter. This parameter is available only if the Option parameter is set to Connect using different user. As with all passwords, If the step is edited in Visual Mode the value is automatically encrypted.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: This sample step connects "\\Server1\Sharename" to "X:" as the user "Tom".  

 

<AMNETDRIVE ACTION="connect_specific_user" DRIVELETTER="X:" NETPATH="//Server1/Sharename" USERNAME="Tom" PASSWORD="AM1a2hwSF+notRqWN7qDphOEw==aME" />

 

↑ Top of Page