Set Environment Variable
AutomatR.DefaultActivities.Environment.SetEnvironmentVariable
The "Set Environment Variable" activity in AutomatR allows you to set or update an environment variable, providing the name, value, and target type (Process, User, or Machine). This activity simplifies the process of managing environment variables within automation workflows.
Properties
Name | Description |
---|---|
Input | |
Variable Name | Enter the name of the environment variable to be set or updated. |
Variable Value | Enter the value for the environment variable. |
Target | Select the type of environment variable for setup (e.g., Process, User, or Machine). |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Set Environment Variable" activity. This can be useful for handling synchronization issues. Integer variable or argument containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
How to use:
- Drag and drop the "Set Environment Variable" activity onto the workflow.
- Configure the properties by specifying the name, value, and target type of the environment variable.
- Optionally, configure the delay and customize the display name.
- Execute the workflow to set or update the specified environment variable.
Example: Consider an example where the "Set Environment Variable" activity is used to set or update the value of the "TEMP" environment variable:
Set Environment Variable:
Display Name: "Set TEMP Variable"
Variable Name: "TEMP"
Variable Value: "C:\Temp"
Target: User
In this example, the activity sets or updates the value of the "TEMP" environment variable for the user, specifying the value "C:\Temp." The operation is performed without direct output; however, the updated value can be retrieved using the "Get Environment Variable" activity if needed.