Get environment variable action

The Get environment variable action enables you to get all the environment variables from the specified local machine and assign it to a variable.

Settings

  • (Optional) In the Environment variable list tab, click the drop-down menu and select one of the variables.

    The following table lists the variable details:

    Variable Description Example value
    ALLUSERSPROFILE Returns the path to the directory that contains resources and settings used by all system accounts.
    Note: Use ProgramData for devices that run Windows Vista and later OS.
    C:\ProgramData
    APPDATA Returns the file path to the application data directory. This directory contains the settings for applications shared across multiple devices. C:\Users\<user>\AppData\Roaming
    COMPUTERNAME Returns the device name without the domain. AA-NY-FRANKSINATRA
    CommonProgramFiles Returns the file path to the Common Files directory. C:\Program Files\Common Files
    CommonProgramFiles(x86) Returns the file path to the Common Files directory.
    Note: This is only available for devices that run 64-bit version.
    C:\Program Files (x86)\Common Files
    CommonProgramW6432 Returns the file path to the Common Files directory.
    Note:
    • This is only available for devices that run 64-bit version.
    • Only use CommonProgramW6432 for devices that run Windows Vista and later OS
    C:\Program Files\Common Files
    ComSpec Returns the file path to the command processor C:\Windows\system32\cmd.exe
    DriverData Returns the file path to the Driver Data directory. C:\Windows\System32\Drivers\DriverData
    HOMEDRIVE Returns the home drive of the device. C:
    HOMEPATH Returns the homepath of the device without the system drive. \Users\<user>
    LOCALAPPDATA Returns the file path to the application data directory. This directory contains the settings for applications shared across multiple devices. C:\Users\<user>\AppData\Local
    LOGONSERVER Returns the name of the group or domain to which the device is connected \\SJCSRVBKP
    NUMBER_OF_PROCESSORS Returns the number of processors in the device. 4
    OneDrive Returns the path to the OneDrive folder. C:\Users\<user>\OneDrive
    OS Returns the device operating system name. Windows_NT
    Path Returns a semicolon-delimited list of directories that contain executable programs. C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
    PATHEXT Returns a semicolon-delimited list of file extensions that the system can execute. .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PROCESSOR_ARCHITECTURE Returns the process architecture of the device. AMD64
    ProgramData Returns the path to the directory that contains resources and settings used by all system accounts.
    Note: Use ALLUSERSPROFILE for devices that run the Windows XP and earlier OS.
    C:\ProgramData
    ProgramFiles Returns the path to the directory that stores installed programs. C:\Program Files
    ProgramFiles(x86) Returns the path to the directory that stores installed programs.
    Note: This is only available for devices that run 64-bit version.
    C:\Program Files (x86)
    ProgramW6432 Returns the path to the directory that stores installed programs. C:\Program Files
    PSModulePath Returns file paths to the modules that are installed on the disk. %ProgramFiles%\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    PUBLIC Returns the Public folder path. C:\Users\Public
    SystemDrive Returns the device system drive. C:
    SystemRoot Returns the system root folder. C:\Windows
    TMP Returns the path to the directory that stores temporary files. C:\Users\<user>\AppData\Local\Temp
    TEMP Returns the path to the directory that stores temporary files. C:\Users\<user>\AppData\Local\Temp
    USERDNSDOMAIN Returns the DNS domain of the user. AAI.AASPL-BRD.COM
    USERDOMAIN Returns the domain of the user. AAI.AASPL-BRD.COM
    USERDOMAIN_ROAMINGPROFILE Returns the domain of the user profile. AAI
    USERNAME Returns the logged-in user name. bob.ross
    USERPROFILE Returns the user profile path. C:\Users\<user>
    windir Returns the Windows directory path. C:\Windows
  • (Optional) Use the Variable tab to add a value for the variable.

    Click Insert a value icon if there is no existing variable.

  • Click the Assign the output to an existing variable drop-down menu and select an existing variable.

    Click the Create variable icon for new variable.