centtech
asked on
Running DOS Commands C# (remove DOS Console)
Hi,
I'm writing a program in c# and i have made it so that i can run the DOS commands that require. The Only Problem i am having is that i cannot remove the black DOS Window that appears when the DOS Commands are run.
my current way of running the dos commands is as attached.
Thanks
I'm writing a program in c# and i have made it so that i can run the DOS commands that require. The Only Problem i am having is that i cannot remove the black DOS Window that appears when the DOS Commands are run.
my current way of running the dos commands is as attached.
Thanks
Process mkdiraudio;
mkdiraudio = Process.Start("cmd", @"/c ipconfig");
mkdiraudio.WaitForExit();
ProcessStartInfo psi = new ProcessStartInfo("cmd", @"/c ipconfig");
psi.WindowStyle = ProcessWindowStyle.Hidden;
Process mkdiraudio = Process.Start(psi);
mkdiraudio.WaitForExit();
ASKER
kinda what i am looking for... the DOS Window still shows up.
i found this on another forum but cant get it to work ? any suggestions?
// The following commands are needed to redirect the standard output. This means that it will be redirected to the Process.StandardOutput StreamReader.
sinf.RedirectStandardOutpu t = true;
sinf.UseShellExecute = false;
// Do not create that ugly black window, please...
sinf.CreateNoWindow = true;
i found this on another forum but cant get it to work ? any suggestions?
// The following commands are needed to redirect the standard output. This means that it will be redirected to the Process.StandardOutput StreamReader.
sinf.RedirectStandardOutpu
sinf.UseShellExecute = false;
// Do not create that ugly black window, please...
sinf.CreateNoWindow = true;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That way you can control whether the window is displayed or not.
See http://forums.msdn.microsoft.com/en-US/csharpgeneral/thread/6d217479-6e45-4e82-938e-97fc9c0a5ff3/
http://bytes.com/forum/thread365970.html