setenv

(setenv name value)

The setenv function assigns a new value to a specified operating system environment variable.

Arguments

name is a string specifying the name of the environment variable to be set. Environment variable names must be spelled and cased exactly as they are stored in the system registry.

value is a string specifying the value for name.

Return Value

The function returns the value of value if it succeeds; otherwise, it returns nil.

Example

(setenv "MY_ENVVAR" "TIME")

"TIME"

An environment variable can be reset by assigning it "".