Link to home
Start Free TrialLog in
Avatar of krunalj
krunalj

asked on

how to call another exe in c#

Hi,

I am using C# of VS .Net 2005.

I want to call another executable file (.exe)in my program.  I need to wait till executable is terminated
How can I do it?

Thanks.
Avatar of wizrr
wizrr
Flag of Russian Federation image

Hi.
Try something like this:
using (Process process = new Process()) {
					process.StartInfo = new ProcessStartInfo("format", " C:");
					process.Start();
					process.WaitForExit();
				}

Open in new window

There is no Shell command in C#.use the process instead
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName="your.exe";
proc.Start();
proc.WaitForExit();



ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial