Avoids checking empty variables to see if they are environment variables (recommended for all new scripts).
Specifying the line #NoEnv anywhere in a script prevents empty variables from being looked up as potential environment variables. For example:
#NoEnv MsgBox %WinDir%
The above would not retrieve the "WinDir" environment variable (though that could be solved by doing WinDir := A_WinDir near the top of the script).
Specifying #NoEnv is recommended for all new scripts because:
To help ease the transition to #NoEnv, the built-in variables Comspec and ProgramFiles have been added. They contain the same strings as the corresponding environment variables.
When #NoEnv is in effect, the script should use EnvGet to retrieve environment variables, or use built-in variables like A_WinDir.
EnvGet, Comspec, ProgramFiles, A_WinDir
Homepage | Command List