EnvGet [v1.0.43.08+]

Retrieves an environment variable.

EnvGet, OutputVar, EnvVarName



The name of the variable in which to store the string.


The name of the environment variable to retrieve. For example: EnvGet, OutputVar, Path.


If the specified environment variable is empty or does not exist, OutputVar is made blank.

The operating system limits each environment variable to 32 KB of text.

EnvSet, #NoEnv, environment variables, EnvUpdate, SetEnv, Run, RunWait


Retrieves an environment variable and stores its value in OutputVar.

EnvGet, OutputVar, LogonServer

Retrieves and reports the path of the "Program Files" directory. See RegRead example #2 for an alternative method.

EnvGet, OutputVar, % A_Is64bitOS ? "ProgramW6432" : "ProgramFiles"
MsgBox, Program files are in: %OutputVar%