Assuming you're ready to rely on the Windows API when you call the CreateProcess function to start the process, you have lpEnvironment .
Usually you pass NULL , which means use the creation process environment. However, you can provide an environment block that will be used by the new process.
The protection block that you pass is a zero-terminated block with zero-termination. For example:
"MyVar=MyValue\0MyOtheVar=MyOtherValue\0\0"
defines two separate variables.
David heffernan
source share