我正在尝试使用QProcess启动程序(tftp)。无论我如何开始它,它都不会运行。 我试图添加绝对路径,在cmd shell中调用它,但它就像系统找不到它。我在Windows 8上,使用qt 4.8
QString command("C:\\Windows\\System32\\tftp.exe");
QProcess* downloadProcess = new QProcess(this);
downloadProcess->setWorkingDirectory("C:\\Windows\\System32");
downloadProcess->setReadChannelMode(QProcess::MergedChannels);
connect(downloadProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(onDownloadFinished(int,QProcess::ExitStatus)));
connect(downloadProcess, SIGNAL(error(QProcess::ProcessError)),
this, SLOT(onProcessError(QProcess::ProcessError)));
connect(downloadProcess, SIGNAL(started()),
this, SLOT(onProcessStart()));
downloadProcess->start(command);
结果:“进程无法启动:没有此类文件或目录
可能是由于执行权限还是其他原因? (howeve tftp在shell中正常运行)