Reading environment variable set by child process in C #

I just started a new process from my code. This new process calls a command program that sets several variables and starts its program.

Is there a way to get the values ​​of the variables that the child program sets?

thanks

+4
source share
1 answer

You can set the environment variable ProcessStartInfo.EnvironmentVariables , so if you can find a way to get them in advance, you won’t be able to exchange environments.

I am not in the IDE, so I can’t confirm, but you can use this method after the fact (although I doubt it).

You can also have a parent process in a script package and parse the output.

master.exe set 
0
source

Source: https://habr.com/ru/post/1343387/


All Articles