Writes a value to the specified environment variable.

EnvSet, EnvVar, Value


The name of the environment variable, e.g. Path.

The value to write.

Error Handling

[v1.1.04+]: This command is able to throw an exception on failure. For more information, see Runtime Errors.

ErrorLevel is set to 1 if there was a problem or 0 otherwise.


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

An environment variable created or changed with this command will be accessible only to programs the script launches via Run or RunWait. See environment variables for more details.

This command exists separately from SetEnv because normal script variables are not stored in the environment. This is because performance would be worse and also because the OS limits environment variables to 32 KB.

EnvGet, #NoEnv, EnvUpdate, SetEnv, Run / RunWait


Writes some text to an environment variable.

EnvSet, AutGUI, Some text to put in the environment variable.