How to start Process hidden?

前端 未结 4 1586
心在旅途
心在旅途 2020-12-01 14:19

I start a Console Application via ProcessStartInfo and process.Start(). I want to hide the black window. Here\'s my code:

string output = \"\";
//Setup the          


        
相关标签:
4条回答
  • 2020-12-01 14:38

    Try

    startInfo.WindowStyle = ProcessWindowStyle.Hidden;
    
    0 讨论(0)
  • 2020-12-01 14:44

    Try This:

    startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
    
    0 讨论(0)
  • 2020-12-01 14:53

    The final answer is

     ProcessStartInfo psi = new ProcessStartInfo();
     psi.FileName = ....
     psi.RedirectStandardInput = true;
     psi.RedirectStandardOutput = false;
     psi.Arguments =...
     psi.UseShellExecute = false;
    

    psi.CreateNoWindow = true; // <- key line

    0 讨论(0)
  • 2020-12-01 14:57
    Process p = new Process();
    ....
    p.StartInfo.CreateNoWindow = true;
    p.Start();
    
    0 讨论(0)
提交回复
热议问题