setEnvironmentVar

fnvoid setEnvironmentVar(string key, string value) @trusted nothrow

Sets an environment variable for a process.

Note

This only affects the current process and its future children.

It's not possible to modify environment variables of other processes.

Parameters

keyEnvironment variable name.
valueEnvironment variable value. Example:
setEnvironmentVar("MY_VAR", "my_value");
writeln(getenv("MY_VAR")); // "my_value"