C# 执行bat批处理文件

C# 执行bat批处理文件
 
 1 ///batPath为.bat 可执行文件的绝对路径
 2 private void RunBat(string batPath)
 3 {
 4 Process pro = new Process(); 
 5 FileInfo file = new FileInfo(batPath);
 6 pro.StartInfo.WorkingDirectory = file.Directory.FullName;
 7 pro.StartInfo.FileName = batPath;
 8 pro.StartInfo.CreateNoWindow = True;//隐藏窗体的显示
 9 pro.Start();
10 pro.WaitForExit();
11 }
You can reach me by surfing the web ---- huntjobs.cn,or sending e-mails to me,Here is my qq MailBox:1424870395@qq.com
原文地址:https://www.cnblogs.com/HedgehogBlog/p/3376301.html