Small example of C executing bat batch files

  • 2020-05-19 05:40:58
  • OfStack


private void RunBat(string batPath)
{
Process pro = new Process(); 
FileInfo file = new FileInfo(batPath);
pro.StartInfo.WorkingDirectory = file.Directory.FullName;
pro.StartInfo.FileName = batPath;
pro.StartInfo.CreateNoWindow = false;
pro.Start();
pro.WaitForExit();
}


Related articles: