EnvSet

Writes a value to the specified environment variable.

EnvSet EnvVar , Value

Parameters

EnvVar

Type: String

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

Value

Type: String

If omitted, the environment variable will be deleted. Otherwise, specify the value to write.

Error Handling

An OSError is thrown on failure.

Remarks

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

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

This function exists 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, Run / RunWait

Examples

Writes some text to an environment variable.

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