C#, Wie man laufen ein .bat-Datei, die, ohne ein popup-Fenster Konsole

Ich versuche zu laufen, ein .bat Datei ohne ein popup-Fenster Konsole.

Ich bin mit diesem code:

Process p = new Process();

p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "file.bat";
p.Start();

string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();

Mit diesem code, das Programm öffnet sich ein Konsole-Fenster für eine Sekunde und verschwindet. Wie um es zu bekommen, so dass es nie zeigt?

  • Und was ist passiert...?
  • ein Konsolenfenster öffnet sich für eine Sekunde , Kann ich es loswerden??
  • Denke, der start-info Parameter ist createnowindow auf mein Handy atm
  • Project -> Properties -> Application in Visual Studio -> Output type. Ändern von 'console' auf 'windows-Anmeldung".
  • Es öffnet sich ein Konsolenfenster, weil, Sie eine .bat-Datei....
InformationsquelleAutor Hady Hallak | 2013-08-02
Schreibe einen Kommentar