Environment Variables - Delete

Declaration

<AMREMOVEENVIRONMENT NAME="text" TYPE="text(options)" />

See Also

Environment Variables - Append | Environment Variables - Delete | Environment Variables - Get | Environment Variables - List | Environment Variables - Set

Description

Removes a system or user-level environment variable.

IMPORTANT: Basic knowledge about Windows system and user level environment variables and their functionality are required in order to properly use these activities.

Practical Usage

Normally used to delete an existing environment variable created by the Set Environment Variable action.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Environment Variable Name

Text

Yes

(Empty)

NAME="TEMP"

The name of the environment variable to remove.

Environment Variable Scope

Text

Yes

User

TYPE="USER"

The scope of the environment variable. The available options are:

  • User

  • Machine

  • Process

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 task demonstrates a number of activities related to environment variables. An Environment Variable - Set activity creates a new environment variable of type "User" named "AMTemp" along with the value of "AutoMate Training". A Create Variable action creates an AutoMate variable named "EnvironmentVarValue". An Environment Variable - Get activity populates the AutoMate variable with the value of the newly created environment variable. Thereafter, a Message Box activity displays the value of the created environment variable. The final step deletes the environment variable with the use of the Environment Variables - Delete activity.

 

<AMENVVARS ACTIVITY="set" TYPE="USER" NAME="AMTemp" VALUE="AutoMate Training" />

<AMVARIABLE NAME="EnvironmentVarValue"></AMVARIABLE>

<AMENVVARS TYPE="USER" NAME="AMTemp" RESULTVARIABLE="EnvironmentVarValue" />

<AMSHOWDIALOG>The value of environment variable 'AMTemp' is '%EnvironmentVarValue%'.</AMSHOWDIALOG>

<AMENVVARS ACTIVITY="delete" TYPE="USER" NAME="AMTemp" />

 

↑ [Top of Page]