I'm trying to set environment variables that will be visible when my D program exits. It is possible in a windows batch file using the set command (like set "VAR=VALUE" )

However, running this in D using:

import std.process;
import std.stdio;

void main(){

auto pid1 = spawnShell(`set "VAR=VALUE"`);
pid1.wait();
auto pid2 = spawnShell(`set`);
pid2.wait();
}


however, upon exit, there is no VAR=VALUE in the environment.

Using std.process.environment["VAR"]= "VALUE"; doesnt store the variable in the parent either.

Any solutions that people know of?

Reply via email to