![](/img/trans.png)
[英]Error in Process.Start() – The System cannot find the file specified
[英]Process.Start cannot find the executable
我想从我的.NET应用程序中更改BCD。 为此,我创建了这个小片段:
static void RunBcdEdit()
{
Process process = new Process();
process.StartInfo.FileName = "c:\\Windows\\System32\\bcdedit.exe";
process.StartInfo.UseShellExecute = false;
process.WaitForExit();
}
奇怪的是,它引发了一个例外
系统找不到指定的文件
这有什么问题?
我在使用System32运行应用程序时遇到了类似的问题。 我找到的解决方法是使用SysNative。 在测试中,当System32工作或SysNative适用于驻留在System32中的不同应用程序时,没有一致性。
static void RunBcdEdit()
{
Process process = new Process();
process.StartInfo.FileName = "c:\\Windows\\SysNative\\bcdedit.exe";
process.StartInfo.UseShellExecute = false;
process.WaitForExit();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.