How to start a process from c#?

  • Thread starter Thread starter R.A.
  • Start date Start date
R

R.A.

Hi

The application I am working on should start an external exe application and
wait for its result. The external application is most likely not a .net app.
How can I call the exe from c# code and get the result code or when the exe
finished processing?


Thanks
 
Hi,

Take a look at System.Diagnostics.Process

and ExitCode property.

Cheers,i
 
using System.Diagnostics
....
Process x = Process.Start("XYZ.EXE");
x.WaitForExit();
int exitCode = x.ExitCode;

(Note: I didn't test this code)

Niki
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top