
[code=csharp] string cmdtext = "C:\\Windows\\System32\\powercfg.exe -setactive a1841308-3541-4fab-bc81-f71556f20b4a";
Process MyProcess = new Process();
//设定程序名
MyProcess.StartInfo.FileName = "cmd.exe";
//关闭Shell的使用
MyProcess.StartInfo.UseShellExecute = false;
//重定向标准输入
MyProcess.StartInfo.RedirectStandardInput = true;
//重定向标准输出
//MyProcess.StartInfo.RedirectStandardOutput = true;
//重定向错误输出
// MyProcess.StartInfo.RedirectStandardError = true;
//设置不显示窗口
MyProcess.StartInfo.CreateNoWindow = true;
//执行VER命令
MyProcess.Start();
MyProcess.StandardInput.WriteLine(cmdtext);
MyProcess.StandardInput.WriteLine("exit");
------解决思路----------------------
检查操作系统、framework版本,系统电源管理设置等差异