0

I am writing a application in C# to access git-bash on run a script in git-bash. I need to hide git-bash.exe.

I have tested the following code but it does not work:

Process process = new Process
        {
            StartInfo = new ProcessStartInfo
            {
                FileName = "C:\\Program Files\\Git\\git-bash.exe",
                UseShellExecute=false,
                Arguments = "-c ./script.sh",
                WorkingDirectory = Directory.GetCurrentDirectory(),
                WindowStyle = ProcessWindowStyle.Hidden
            }
        };

        process.Start();

It opens the git-bash and runs the script successful but it does not hide thew window. I have already tested all suggested methods in other posts but still no luck.

NoneCoder
  • 41
  • 3

1 Answers1

0

Did you try setting CreateNoWindow option to false?

Eldar
  • 9,781
  • 2
  • 10
  • 35