I have this code:
ProcessStartInfo PSI = new ProcessStartInfo("cmd.exe");
PSI.CreateNoWindow = true;
PSI.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
PSI.RedirectStandardInput = true;
PSI.RedirectStandardOutput = true;
PSI.RedirectStandardError = true;
PSI.UseShellExecute = true;
Process p = Process.Start(PSI);
problem is, when I build it, the command prompt still appears. How can I hide it?Thanks!
In Visual Studio, change the output type under Application in the project properties to Windows Application.
Project Properties > Application > Output Type: “Windows Application”
Also try: