using System.Diagnostics;
/// <summary>
/// 执行CMD命令返回信息
/// </summary>
/// <param name="Command">命令</param>
/// <returns>返回命令执行结果</returns>
public string executeCmd(string Command)
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe ";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine(Command);
p.StandardInput.WriteLine("exit");
System.Threading.Thread.Sleep(1000);
string Re= p.StandardOutput.ReadToEnd();
p.StandardOutput.Close();
p.WaitForExit();
p.Close();
return Re;
}