pls help. i have to create a batch program that will run mutiple exe file. each exe file has dependency to each other so exe1 should run completely before running exe2. in c#.net, how to determine if an exe file run completely or should i say how will i
program this procedure? i have no idea on what systax should i use.
Process p = new Process();
// Redirect the error stream of the child process.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.FileName = "Write500Lines.exe";
p.Start();
// Do not wait for the child process to exit before
// reading to the end of its redirected error stream.
// p.WaitForExit();
// Read the error stream first and then wait.
string error = p.StandardError.ReadToEnd();
p.WaitForExit();
Please remember to click “Mark as Answer” on the post that helps you.
This can be beneficial to other community members reading the thread.
quickmelt
Member
83 Points
60 Posts
creating a program running multiple exe file
Apr 26, 2012 01:22 AM|LINK
hi
pls help. i have to create a batch program that will run mutiple exe file. each exe file has dependency to each other so exe1 should run completely before running exe2. in c#.net, how to determine if an exe file run completely or should i say how will i program this procedure? i have no idea on what systax should i use.
thanks
ramanselva
Contributor
2064 Points
324 Posts
Re: creating a program running multiple exe file
Apr 26, 2012 01:49 AM|LINK
Hi, You can use as given, where WaitForExit - wait till the associated process to complete..
below article have some samples
http://www.dotnetperls.com/process-start
This can be beneficial to other community members reading the thread.
Regards,
Rama Selvam M.
quickmelt
Member
83 Points
60 Posts
Re: creating a program running multiple exe file
Apr 26, 2012 03:29 AM|LINK
thank you :-)