您的位置:首页 > 编程语言 > C#

C# 执行bat批处理文件

2015-11-30 22:37 495 查看
</pre><pre name="code" class="csharp">
</pre><pre name="code" class="csharp">    
    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();
        }


转载自[ http://www.cnblogs.com/zjfree/ ],亲测可用,感谢分享
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: