TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
e101000
NA
3
0
Process.WaitForExit() not working?
Jun 2 2004 11:31 AM
have a ASP.NET form that starts an async method that loops through a list of executable files and starts them off In the button click I call my async method --------------------------------------------------------------------------------------------------------- startBtchRunD = new StartBatchRunDelegate(StartBatchRun); startBtchRunD.BeginInvoke(newBatchRunId,DBConnectionString,ExecutableDirectory,new AsyncCallback(this.GoDone),null); --------------------------------------------------------------------------------------------------------- My method has the following loop ---------------------------------------------------------------------------------------------------------- foreach(Executable exe in Executables) { procStartInfo = new ProcessStartInfo(@"c:\windows\system32\wscript.exe",exe.File); procStartInfo.RedirectStandardOutput = true; procStartInfo.UseShellExecute = false; Process p = new Process(); p = Process.Start(procStartInfo); p.Start(); string output = p.StandardOutput.ReadToEnd(); p.WaitForExit(); } -------------------------------------------------------------------------------------------------------- For some reason the wait for exit doesn't seem to be doing anything. This loop doesn't wait at all. If I have 4 executables ".vbs" files, they all start pretty much at the same time. Any ideas on why this doesn't seem to be working would be helpful. I tried to run this from within a windows service and it had the same problem. I must be missing something.
Reply
Answers (
1
)
C# public class declaration
Vb.Net Videos