Ich möchte NETSH-Befehl still (ohne Fenster) ausführen. Ich habe diesen Code geschrieben, aber es funktioniert nicht.Führen Sie einen unbeaufsichtigten Prozess im Hintergrund ohne Fenster
public static bool ExecuteApplication(string Address, string workingDir, string arguments, bool showWindow)
{
Process proc = new Process();
proc.StartInfo.FileName = Address;
proc.StartInfo.WorkingDirectory = workingDir;
proc.StartInfo.Arguments = arguments;
proc.StartInfo.CreateNoWindow = showWindow;
return proc.Start();
}
string cmd= "interface set interface name=\"" + InterfaceName+"\" admin=enable";
ExecuteApplication("netsh.exe","",cmd, false);
Nun, du gibst 'false' für' CreateNoWindow' ein ... also hast du * gebeten * ein Fenster zu erstellen. –