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.