views:

163

answers:

3
  • Can you pass arguments?
  • Can you get the exit code back?
+6  A: 

Yes, yes and yes. See the System.Diagnostics.Process class.

Henk Holterman
+1  A: 

Yes you can. See this forum thread for the details

Waleed Eissa
+11  A: 

Like this:

        var proc = new Process();
        proc.StartInfo.FileName = "something.exe";
        proc.StartInfo.Arguments = "-v -s -a";
        proc.Start();
        proc.WaitForExit();
        var exitCode = proc.ExitCode;
        proc.Close();
Jonas Lincoln
+1, just missed arguments part
Rubens Farias
Yes, of course. I'll edit and add.
Jonas Lincoln