I have my own application for building a huge set of C++ projects. On Windows I need to set the environment variables via vcvarsall.bat, but how can I execute the batch from a C++ console app in the context of the current process, so that the environment the batch creates is kept for my app? Both _spawnvp and ShellExecuteEx create a dedicated process.
Edit: I of course know how to execute a process or batch, but I want to know to preserve the environment the batch creates.