我想在我的C#项目中运行的NirCmd进程(Windows窗体应用程序),所以我是这样的:如何在C#项目中运行nircmd.exe进程,Windows 10?
Process mute_process = new Process();
mute_process.StartInfo.FileName = "C:\\(**my path**)\\nircmd.exe mutesysvolume 1 ";
mute_process.Start();
可惜的是我的程序引发的错误:
"Unhandled exception has occured in your aplication. If you click Continue, the application will ignore this error [...] The system cannot find the file specified."
在我的C#程序其他进程为我工作(例如从特定目录运行mp3文件)。而且,nircmd进程本身在cmd中运行良好。我究竟做错了什么?
你需要通过“mutesysvolume 1”作为[参数] (https://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.arguments(v=vs.110).aspx),而不是路径的一部分。 – Filburt