473,385 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to call Two processes sequentially

In my application I have two lines like:

1) Process.Start(Exe1)
2)Process.Start(Exe2)

Problem is that these two guys run together ,and I want the first process is
run first and when it's finished the second process is called.

Just for your info .First process is CEAPPMANAGER.EXE which an executable
which installs a .Net compact framework on the device and the second process
is simply a console application

Thanks
Nov 17 '05 #1
2 1810
Two solutions -
1) If you do not mind YOUR program blocking, you can do it like:

Process proc = Process.Start("prog1.exe");
proc.WaitForExit();

proc = Process.Start("prog2.exe");
proc.WaitForExit(); //you may not need this second one
2) If you want your program to be able to do other things while the first
process is running, you can add a handler for the Exited event:
Process proc = Process.Start("prog1.exe");
proc.Exited += new EventHandler(proc1_Exited);

and have a method for it:
private void proc1_Exited(object sender, EventArgs e)
{
Process proc = Process.Start("prog2.exe");
}
HTH
--
Adam Clauss
ca*****@tamu.edu

"Ray5531" <Ra*****@microsoft.com> wrote in message
news:un*************@TK2MSFTNGP12.phx.gbl...
In my application I have two lines like:

1) Process.Start(Exe1)
2)Process.Start(Exe2)

Problem is that these two guys run together ,and I want the first process
is run first and when it's finished the second process is called.

Just for your info .First process is CEAPPMANAGER.EXE which an executable
which installs a .Net compact framework on the device and the second
process is simply a console application

Thanks

Nov 17 '05 #2
Excellent.I appreciate your help.

Ray
"Adam Clauss" <ca*****@nospam.tamu.edu> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Two solutions -
1) If you do not mind YOUR program blocking, you can do it like:

Process proc = Process.Start("prog1.exe");
proc.WaitForExit();

proc = Process.Start("prog2.exe");
proc.WaitForExit(); //you may not need this second one
2) If you want your program to be able to do other things while the first
process is running, you can add a handler for the Exited event:
Process proc = Process.Start("prog1.exe");
proc.Exited += new EventHandler(proc1_Exited);

and have a method for it:
private void proc1_Exited(object sender, EventArgs e)
{
Process proc = Process.Start("prog2.exe");
}
HTH
--
Adam Clauss
ca*****@tamu.edu

"Ray5531" <Ra*****@microsoft.com> wrote in message
news:un*************@TK2MSFTNGP12.phx.gbl...
In my application I have two lines like:

1) Process.Start(Exe1)
2)Process.Start(Exe2)

Problem is that these two guys run together ,and I want the first process
is run first and when it's finished the second process is called.

Just for your info .First process is CEAPPMANAGER.EXE which an executable
which installs a .Net compact framework on the device and the second
process is simply a console application

Thanks


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bruce W.1 | last post by:
With ASP.NET I've found that request are processed sequentially, one at a time, at least on a server with one CPU. If one request blocks for some reason, maybe on a long database query, then all...
0
by: Hubert Baumeister | last post by:
Fifth International Conference on eXtreme Programming and Agile Processes in Software Engineering XP2004 June 6-10, 2004, Garmisch-Partenkirchen, Germany http://www.xp2004.org/
2
by: dynoweb | last post by:
I have several *.sql files with schema/data changes to be applied to our current database. Is there a way to create a TSQL script that could be run from the SQL Query Analyzer that would...
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
5
by: Bob Day | last post by:
Using vs 2003, vb.net It is not clear from the documentation, but it appears that a raised event will traverse up the call stack upwards until it reaches its handler. Is this correct? See the...
2
by: Alex | last post by:
Hello, All. I encouraged some strange behaviour of either IIS, ASP.NET, IE or donn't know what... I have a simple wait.aspx page private void Page_Load(object sender, System.EventArgs e) {...
35
by: Carl J. Van Arsdall | last post by:
Alright, based a on discussion on this mailing list, I've started to wonder, why use threads vs processes. So, If I have a system that has a large area of shared memory, which would be better? ...
3
by: pbd22 | last post by:
Hi. I have a C# program that fires an external VB6 program which writes to a file and terminates. It is ugly, but this is how I have to do it. I cannot change this part of the program. The...
2
by: Radz | last post by:
when the fork system call is executed, a new process is created. The original process is called the parent process whereas the new process is called the child process. The new process consists of a...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.