Qt实施一个bat文件

Qt执行一个bat文件?如题,有没有人做过?[解决办法]QProcess pp.start(cmd.exe, QStringList() /c

Qt执行一个bat文件?
如题,有没有人做过?
[解决办法]


QProcess p;
p.start("cmd.exe", QStringList() << "/c" << "c:\\uti\\mybat.bat");
if (p.waitForStarted()) 
{
   p.waitForFinished();
   qDebug() << p.readAllStandardOutput();
}
else
   qDebug() << "Failed to start";