I’m executing an external application using the CreateProcess function, in order which such application be executed I need run a .bat file before to set some environments variables. The issue is when i call CreateProcess to run the bat file and then execute CreateProcess again for run the external app the environment variables are not used. The question is how i can use the environment variables set in the bat file when I execute CreateProcess function the second time?
I’m executing an external application using the CreateProcess function, in order which such application
Share
If the initial createprocess batch file is simply to setup the environment variables, create the enviornment variable block instead and pass it directly via the CreateProcess() call.
Some sample code is available here for getting/setting environment variables and for passing a block to CreateProcess() http://www.delphidabbler.com/articles?article=6