C#cmd执行命令隐藏窗口,并保持程序一直运行
把要执行的cmd命令放入一个bat文件里,然后执行:
//Process p = Process.Start(bPath);
Process pro = new Process();
pro.StartInfo.FileName = bPath;
pro.StartInfo.CreateNoWindow = true;
pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
pro.Start();