1

I tried this :

Process CMDprocess = new Process();
System.Diagnostics.ProcessStartInfo StartInfo = new System.Diagnostics.ProcessStartInfo();
StartInfo.FileName = "cmd"; //starts cmd window
StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
StartInfo.CreateNoWindow = true;
StartInfo.RedirectStandardInput = true;
StartInfo.RedirectStandardOutput = true;
StartInfo.UseShellExecute = false; //required to redirect
CMDprocess.StartInfo = StartInfo;
CMDprocess.Start();
System.IO.StreamReader SR = CMDprocess.StandardOutput;
System.IO.StreamWriter SW = CMDprocess.StandardInput;
SW.WriteLine(AppDomain.CurrentDomain.BaseDirectory + "\\my_bat.bat");

But it shows me the .bat window and the .bat file is open another C++ application.

How can I not show the window ?

Alex
  • 23,004
  • 4
  • 39
  • 73
  • Take a look here, http://stackoverflow.com/questions/1096591/how-to-hide-cmd-window-while-running-a-batch-file – Matt Mar 07 '14 at 14:14

0 Answers0