G
Guest
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
files and registry and environment variables, the second one will do
something else, assuming the registry and env vars are there.
The problem is that the second process doesn't seem to be able to pick up
the registry and env vars done by the first process. The makes me think the
new Process() is not that "NEW". Any idea?
executable = "setup_listener.bat";
process1 = new Process();
process1.StartInfo.UseShellExecute = false;
process1.StartInfo.CreateNoWindow = false;
process1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process1.StartInfo.FileName = executable;
//process1.StartInfo.RedirectStandardOutput = true;
process1.Start();
process1.WaitForExit();
executable = "create_xdb_service.bat";
process3 = new Process();
process3.StartInfo.UseShellExecute = false;
process3.StartInfo.CreateNoWindow = false;
process3.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process3.StartInfo.FileName = executable;
//process3.StartInfo.RedirectStandardOutput = true;
process3.Start();
process3.WaitForExit();
programs, they need to be run in order. the first one will install some
files and registry and environment variables, the second one will do
something else, assuming the registry and env vars are there.
The problem is that the second process doesn't seem to be able to pick up
the registry and env vars done by the first process. The makes me think the
new Process() is not that "NEW". Any idea?
executable = "setup_listener.bat";
process1 = new Process();
process1.StartInfo.UseShellExecute = false;
process1.StartInfo.CreateNoWindow = false;
process1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process1.StartInfo.FileName = executable;
//process1.StartInfo.RedirectStandardOutput = true;
process1.Start();
process1.WaitForExit();
executable = "create_xdb_service.bat";
process3 = new Process();
process3.StartInfo.UseShellExecute = false;
process3.StartInfo.CreateNoWindow = false;
process3.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process3.StartInfo.FileName = executable;
//process3.StartInfo.RedirectStandardOutput = true;
process3.Start();
process3.WaitForExit();