c#调用bat脚本

var pStartInfo = new System.Diagnostics.ProcessStartInfo("D:/xxxx.bat");

            pStartInfo.CreateNoWindow = false; // 若要启动该进程而不创建包含它的新窗口

            pStartInfo.UseShellExecute = true;  //true调用的是 ShellExecute;false调用的是 CreateProcess

            pStartInfo.RedirectStandardError = false; //重定向标准错误 

            pStartInfo.RedirectStandardInput = false; //重定向标准输入 

            pStartInfo.RedirectStandardOutput = false; //重定向标准输出

            System.Diagnostics.Process.Start(pStartInfo);

posted @ 2022-04-29 14:39  zwbsoft  阅读(292)  评论(0编辑  收藏  举报