如何通过c#运行这个命令"bcdedit /set testsigning on“?这是我的代码- no run:
string strCmdLine;
strCmdLine = "bcdedit /set testsigning on";
Process.Start("CMD.exe", strCmdLine);发布于 2010-11-16 21:45:57
这里缺少有关实际问题的一些细节...
这是我的猜测,我认为你错过了/c标志。
string strCmdLine;
strCmdLine = "/c bcdedit /set testsigning on";
Process.Start("CMD.exe", strCmdLine);有关/c标志(cmd /?)的更多详细信息,请参阅cmd.exe的帮助。
发布于 2010-11-16 20:13:48
可以尝试System.Diagnostics.Process.Start("CMD.exe","bcdedit /set testsigning on“);
发布于 2010-11-17 00:10:21
你可以这样做,只需将"format“替换为"bcdedit",并将"/?”替换为"/set testsigning on“
ProcessStartInfo info = new ProcessStartInfo("format", "/?");
info.UseShellExecute = false;
info.RedirectStandardOutput = true;
string output = Process.Start(info).StandardOutput.ReadToEnd();
Console.WriteLine(output);如果您不关心输出,那么您不需要最后两行,您还应该考虑重定向错误输出并将其转发到控制台(以防您收到任何错误
https://stackoverflow.com/questions/4193900
复制相似问题