Process p = new Process();//設定調用的程序名,不是系統目錄的需要完整路徑 p.StartInfo.FileName = "cmd.bat";//傳入執行參數 p.StartInfo.Arguments = ""; p.StartInfo.UseShellExecute = false;//是否重定向標准輸入 p.StartInfo.RedirectStandardInput = false;//是否重定向標准轉出 p.StartInfo.RedirectStandardOutput = false;//是否重定向錯誤 p.StartInfo.RedirectStandardError = false;//執行時是不是顯示窗口 p.StartInfo.CreateNoWindow = true;//啟動 p.Start(); p.WaitForExit(); p.Close();