我在c#中以管理员身份启动cmd.exe。我想执行一个将重建性能计数器的CMD命令(“ lodctr /R
”)。
// run cmd to build perfomance counter
string path = @"C:\Windows\System32\cmd.exe";
Process proc = new Process();
proc.StartInfo.FileName = path;
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.RedirectStandardOutput = false;
proc.StartInfo.Verb = "runas";
//proc.StartInfo.Arguments =
proc.Start();
proc.WaitForExit();
我如何以编程方式执行此cmd
命令? StartInfo.Argumments
如何工作???
This picture explain how ("lodctr /R
") rebuild performance counter.