Home Search

DriveWorks Pro 22
Get Environment Variable Value

Send Feedback

Get Environment Variable Value

Retrieves an environment variable value from the local machine running DriveWorks.

Properties

Property NameDescription
TitleChanges the Title (not the name) of the task.
NameThe name of the Environment Variable.
TargetThe scope of the environment variable (Machine, User, Process)

Environment variable Name and Target are non-case sensitive

Example

Property NameExample RuleExample ResultMeaning
Name"username"usernameThis will find the username within the targeted set of environment variables.
Target"machine"machineThis will look for the specified variable name within the scope of machine
Value(Data Output)Returns the value of the variable from the target scope specified.

Using the Task in a Specification Macro

This task has different types of Outputs. For more information about Outputs see Specification Macros Task Node.

Outputs are only available within Specification Macros. Currently Outputs are not available for Specification Flow.

Data Output

Output NameDescription
ValueThe value returned.

Status Outputs

This task supports Status Outputs. These can be used to perform different actions depending on what the status outcome of the task is. For more information see Status Outputs in the Task Node Outputs section of Specification Macros Task Node.

The status output navigation is as follows:

Success

  • Environment Variable named *variable name* value successfully retrieved.

Success with Warnings

  • N/A - should never be fulfilled.

Failed (one of the following occurred)

  • The property value ‘Name’ cannot be left blank.
  • The property value ‘Target’ cannot be left blank.
  • Target specified is not a valid target value. Valid targets are: ‘process’, ‘user’, ‘machine’.
  • Failed to retrieve environment variable value with name specified name and target specified target.
  • The environment variable named specified name could not be found while searching under target specified target.

Useful Resources

Microsoft Article - Environment Variables

Microsoft Article - Recognized environment variables