> I have the code below, I am spawning two process to run two external
> programs, they need to be run in order. the first one will install some
[quoted text clipped - 24 lines]
> process3.Start();
> process3.WaitForExit();
You can't get there from here. Think of the execution environments
being inherited from the process that starts them. A process gets a
copy of its parent environment and can then change it. When it dies,
the changes die with it.
Setting registry keys should work. Another "kludge" is to create an ini
file in process one and let process two read and then delete it.
Alternatively, why not let the first process continue into the second to
use the same environment?
/steveA

Signature
Steve Alpert
my email Fgrir_Nycreg @ vqk.pbz is encrypted with ROT13 (www.rot13.org)
and spaces
Ed Kaim - 23 Dec 2004 06:08 GMT
I believe ProcessStartInfo has an EnvironmentVariables property, which you
can use to set env for the second process. The trick will be to get the env
variables out of the first process, which might not be too hard if you can
hardcode or detect during execution. Otherwise, if you own the code from the
first bat, you can have the first process output them and read it from the
managing app by reading from Process.StartInfo.RedirectStandardOutput. It's
kind of a hack, but it works if you're just using it for internal stuff.
>> I have the code below, I am spawning two process to run two external
>> programs, they need to be run in order. the first one will install some
[quoted text clipped - 33 lines]
>
> /steveA