我需要从 .NET windows 应用程序执行命令行。
我尝试使用此代码,但出现错误:
'C:\Documents' 不是内部或外部命令、可运行程序或批处理文件。
var command ="\"C:\\Documents and Settings\\Administrator\\My Documents\\test.exe\" \"D:\\abc.pdf\" \"C:\\Documents and Settings\\Administrator\\My Documents\\def.pdf\"";
var processInfo = new ProcessStartInfo("cmd","/c " + command)
{
UseShellExecute = false,
RedirectStandardError = true,
CreateNoWindow = true
};
var p = Process.Start(processInfo);