引用命名空间 using System.Diagnostics; string sPath = "d://test//test.bat"; string sDict = "d://test//"; ProcessStartInfo psi = new ProcessStartInfo("cmd.exe"); psi.UseShellExecute = false; psi.RedirectStandardOutput = true; psi.RedirectStandardInput = true; psi.RedirectStandardError = true; psi.Arguments = sPath; psi.WorkingDirectory = sDict; // Start the process System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi); // Attach the output for reading System.IO.StreamReader sOut = proc.StandardOutput; proc.Close(); // Read the sOut to a string.