How to run batch file using Concole application

To run a .exe file using console application you need to do the following.

Process proc = new Process();
proc.StartInfo.WorkingDirectory = _filePath;
proc.StartInfo.FileName = _fileName;
proc.StartInfo.CreateNoWindow = false;
proc.Start();
proc.WaitForExit();

Comments