Re: Process.Start Problem with WaitForExit(), WaitForExit DOES NOT WA
From: Richard A. Lowe (chadich_at_yumspamyumYahoo.com)
Date: 12/22/04
- Next message: pei_world: "Re: ComboBox in DataGrid,"
- Previous message: scott_wu: "Help please dbgheap error"
- In reply to: James Li: "Process.Start Problem with WaitForExit(), WaitForExit DOES NOT WA"
- Next in thread: James Li: "Re: Process.Start Problem with WaitForExit(), WaitForExit DOES NO"
- Reply: James Li: "Re: Process.Start Problem with WaitForExit(), WaitForExit DOES NO"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 21 Dec 2004 22:46:13 -0600
Well, what are you batch files doing? It's possible, I guess, that they are
starting other processes in a way that they do not block the .bat file
process.
-- C#, .NET and Complex Adaptive Systems: http://blogs.geekdojo.net/Richard "James Li" <JamesLi@discussions.microsoft.com> wrote in message news:BCAA32AA-8144-41DF-9018-B7C2D7E8E337@microsoft.com... >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();
- Next message: pei_world: "Re: ComboBox in DataGrid,"
- Previous message: scott_wu: "Help please dbgheap error"
- In reply to: James Li: "Process.Start Problem with WaitForExit(), WaitForExit DOES NOT WA"
- Next in thread: James Li: "Re: Process.Start Problem with WaitForExit(), WaitForExit DOES NO"
- Reply: James Li: "Re: Process.Start Problem with WaitForExit(), WaitForExit DOES NO"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|