sys.env readonly property

Get a proxy table representing environment variables. To set or get an environment variable, just index the table with the variable name.

The property is only for current program execution. Changes have no effect on the Windows system environment variables or the environment variables of other processes.

Example

-- get the current Windows installation path print("Windows installation path: "..sys.env["windir"]) -- set the local environment variable "root" sys.env["root"] = "C:\\" print("root environment variable: "..sys.env["root"])