07-23-2023, 10:20 AM
I'm trying to run a `.bat` file without a popup console window.
I'm using this code:
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();
With this code, the program pops up a console window for a second and disappears. How to get it so that it never shows?
I'm using this code:
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();
With this code, the program pops up a console window for a second and disappears. How to get it so that it never shows?