C#, How to run a .bat file without a popup console window

batch-file, c#

Solution

just add

p.StartInfo.CreateNoWindow=true;

Console window popup will not appear

Problem

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?

Original source