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();
}
posted @ 2015-01-06 18:15  平民的麦田  阅读(393)  评论(0编辑  收藏  举报