想了解C# 执行bat批处理文件的小例子的相关内容吗,在本文为您仔细讲解C# 执行bat批处理文件的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:C#,bat,批处理文件,下面大家一起来学习吧。
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();
}