G
Guest
I have the code below, the first process takes about 10 minutes to finish.
But the waitForExit doesn't seem to wait when I debug the program, it go
immediately to execute code after the WaitForExit(). The first process
basically launch a DOS batch file to do some task, am I missing anything?
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();
But the waitForExit doesn't seem to wait when I debug the program, it go
immediately to execute code after the WaitForExit(). The first process
basically launch a DOS batch file to do some task, am I missing anything?
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();