Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to hide console window of another executable?

Tags:

c#

Our C# application will launch a console application executable by doing this: Process correctionProcess = Process.Start(exePath, rawDataFileName);

Customer wants to hide that console window which is from their application. Is that possible for us to do that?

like image 552
5YrsLaterDBA Avatar asked Mar 21 '26 19:03

5YrsLaterDBA


1 Answers

You can create the Process with ProcessStartInfo, where the CreateNoWindow and UseShellExecute properties are set to true and false respectively.

ProcessStartInfo startInfo = new ProcessStartInfo(exePath);
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.Arguments = rawDataFileName;

Process.Start(startInfo);
like image 90
Oded Avatar answered Mar 23 '26 08:03

Oded