Possible Duplicate:
C#: Run external console program as hidden
I am using a Windows Forms application that needs to start a console app. I don't want the console app be displayed on windows task
I setting p.WindowStyle = ProcessWindowStyle.Hidden;
But it doesn't work, the process is showing
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 appreciated. Thanks in advance!
The solution:
p.CreateNoWindow = true;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With