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 @ 2013-05-31 18:04  Happy Hu  Views(231)  Comments(0Edit  收藏  举报