Am developing one windows application using c#. After sueecssfull windows login user my exe will trigger to start another 3 exes.For example to
confiure outlook, and execute some other application.it will execute one by one with same log on user.how can start the exe using process object?
can anyone hlep me ?
Thanks and Regards
Arul
Posted Sep 8, 2008, 9:03 AM
You can trap the Exited() event of the currently created process. If this event is fired, you can start the next process. I would like to suggest to avoid batch files here. More about the event here:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.exited.aspx
arulPosted Sep 8, 2008, 7:05 AM
Hi,
Thank you for your reply.Its working fine.My requriement is i need to open multipe application(Exe/Process) one by one.For examle my first application,need to configure outlook for new users.After this configuration automatically open the next process....by this way i need to open.How can i know and open the next application ony by one.I have created batch file.but same time 2 or 3 applications are opend.but i dont want to open like thease please help me.
Thanks and Regards
Arul.P
Posted Sep 8, 2008, 4:12 AM
There are several ways to execute an EXE. The easiest way to achieve that is to use the process model of .NET. The following code starts a the executable in a new process where "path" is your path to the executable including the file name:
System.Diagnostics.Process a = new System.Diagnostics.Process();
a.StartInfo.RedirectStandardOutput = false;
a.StartInfo.FileName = path;
a.StartInfo.UseShellExecute = true;
a.Start();
a.Dispose();
Feel free to contact me, if you have more questions.