fattumsdad
asked on
Avoid Console Flash On Screen
Ok, one more question! If I use this code (courtesey of eternal 21):
System.Diagnostics.Process process = new System.Diagnostics.Process ();
process.StartInfo.FileName = "cmd";
process.StartInfo.UseShell Execute = false;
process.StartInfo.Argument s = "/c net send * hello world!";
process.Start();
Is there a way to hide the console flashing on the screen when executing command line commands?
System.Diagnostics.Process
process.StartInfo.FileName
process.StartInfo.UseShell
process.StartInfo.Argument
process.Start();
Is there a way to hide the console flashing on the screen when executing command line commands?
I had used 'UseShellExecute = false' so that you did not see another window, but assumed that you were in a Windows Application, not a Console Application!
- eternal
- eternal
ASKER
eternal,
I am in a Windows Application :) When I click on button1 to execute the command, a console window pops up for a split second and executes it, then disappears. :)
I am in a Windows Application :) When I click on button1 to execute the command, a console window pops up for a split second and executes it, then disappears. :)
ASKER
When I add:
process.StartInfo.Redirect StandardOu tput = true;
process.StartInfo.Redirect StandardEr ror = true;
It still flashes a "command prompt" for a second :(
process.StartInfo.Redirect
process.StartInfo.Redirect
It still flashes a "command prompt" for a second :(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
eternal,
Rusty or not, you're still helping me out quite a bit!! Works great, thanks again!!!
Rusty or not, you're still helping me out quite a bit!! Works great, thanks again!!!
process.StartInfo.Redirect
process.StartInfo.Redirect