Ok my question is how to get environment variables you change or add to exist outside the scope or life of your .exe program. I can do fine by using the **env argument in int main(int argc, char* argv[], env**). However as soon as my program ends everything is as it was before the program runs, so i'm assuming even though I write straight to the memory location that the variables are in DOS keeps backups of what the previous values were and then changes them back when your program dies.

And yes i've been here: "Environment Variables" any help, even inline assembly would be great, i'm trying to improve DOS externally with .exe files, rather than trying to rewrite COMMAND.COM, yes i'm using the command prompt, but all should be the same. So any suggestions would be greatly appriciated,