Retrieves the value of the specified environment variable.
EnvGet, OutputVar, EnvVar
The name of the output variable in which to store the retrieved value.
The name of the environment variable, e.g. Path
.
If EnvVar has an empty value or does not exist, OutputVar is made blank.
The operating system limits each environment variable to 32 KB of text.
EnvSet, #NoEnv, EnvUpdate, SetEnv, Run / RunWait
Retrieves the value of an environment variable and stores it 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%