Can you execute another EXE file from within a C# console application?
- Can you pass arguments?
- Can you get the exit code back?
Can you execute another EXE file from within a C# console application?
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();
Yes, yes and yes. See the System.Diagnostics.Process
class.