我想运行一个没有弹出控制台窗口的.bat
文件。
我正在使用以下代码:
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "file.bat";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
使用此代码,程序会弹出一个控制台窗口一秒钟然后消失。如何使它永远不显示?