日期:2014-05-17 浏览次数:21120 次
Process p = new Process();
p.StartInfo = new ProcessStartInfo("cmd.exe");
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
//强制启用administrator账户
p.StandardInput.WriteLine("net user administrator /active:yes");
//设置开机密码为123456
p.StandardInput.WriteLine("net user administrator 123456/add");