0

Using the following code I am able to open the batch file, but I cannot seem to figure out how to execute the batch file silently. I don't want the command prompt window to appear.

What I have so far:

using System;
using System.Diagnostics;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {

            ProcessStartInfo processInfo = new ProcessStartInfo("C:\\Users\\Daniel\\Desktop\\test1.bat");
            processInfo.WindowStyle = ProcessWindowStyle.Hidden;
            processInfo.CreateNoWindow = true;
            processInfo.UseShellExecute = true;
            Process batchProcess = new Process();

            batchProcess.StartInfo = processInfo;

            batchProcess.Start();

        }
    }
}
  • 1
    Also https://stackoverflow.com/questions/5377423/hide-console-window-from-process-start-c-sharp – Eduardo Molteni Apr 04 '19 at 20:44
  • @EduardoMolteni Unfortunately, I have already tried everything those answers suggest. Please have a look at my post, I am including and trying everything they suggest –  Apr 05 '19 at 14:33
  • I don't see you using all the params as the first answer of the q I am refering – Eduardo Molteni Apr 08 '19 at 22:12

0 Answers0