Read environment variable set by child process in c#
I just launched a new process from my code. This new process calls a command program that sets few variables and runs its program.
Is there a way i can get th开发者_StackOverflowe values of variables the child program is setting?
Thanks
You can set the environment variable with ProcessStartInfo.EnvironmentVariables so if you can find a way to get those ahead of time, you won't need to share the environments.
I'm not at an IDE so I cannot confirm but you might be able to use that method after the fact (though I doubt it).
You could also have the parent process be a batch script and parse the output.
master.exe
set
精彩评论