Hide the command window
-
Hi, I execute a command from inside my C# program. So the cmd window comes up when the processing realted to the command window is in execution. How do I hide the window programmatically? Here is what i do to execute the command from within the code..... System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo = new System.Diagnostics.ProcessStartInfo(command, commandLineArg); process.Start(); Pls reply asap! Thanks, Sheela
-
Hi, I execute a command from inside my C# program. So the cmd window comes up when the processing realted to the command window is in execution. How do I hide the window programmatically? Here is what i do to execute the command from within the code..... System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo = new System.Diagnostics.ProcessStartInfo(command, commandLineArg); process.Start(); Pls reply asap! Thanks, Sheela
I have not tried this, but... There are
StandardError
,StandardInput
andStandardOutput
streams properties on aProcess
. If you were to assign your own streams to those properties, it should/could/may cause the window to not display.
-
Hi, I execute a command from inside my C# program. So the cmd window comes up when the processing realted to the command window is in execution. How do I hide the window programmatically? Here is what i do to execute the command from within the code..... System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo = new System.Diagnostics.ProcessStartInfo(command, commandLineArg); process.Start(); Pls reply asap! Thanks, Sheela
In your
ProcessStartInfo
object, try setting theWindowStyle
property to Hidden before you start your process.System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo = new System.Diagnostics.ProcessStartInfo(command, commandLineArg);
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
process.Start();RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
In your
ProcessStartInfo
object, try setting theWindowStyle
property to Hidden before you start your process.System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo = new System.Diagnostics.ProcessStartInfo(command, commandLineArg);
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
process.Start();RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
This helped... thanks!:)