How to run a C # console application with a hidden console style?

Possible duplicate:
C #: run external console program as hidden

I am using a Windows Forms application that needs to run a console application. I do not want the console application to appear in the windows task

I setting p.WindowStyle = ProcessWindowStyle.Hidden;

But this does not work, the process shows

code:

 ProcessStartInfo p = new ProcessStartInfo(); p.UseShellExecute = false; p.RedirectStandardOutput = true; p.FileName = "rasdial"; p.Arguments = string.Format("\x22{0}\x22", name); p.WindowStyle = ProcessWindowStyle.Hidden; Process process = Process.Start(p); 

Any help would be greatly appreciated. Thanks in advance!

+4
source share
1 answer

Decision:

 p.CreateNoWindow = true; 
+8
source

All Articles