我在使用taskkill.
我的代碼:
QStringList args;
args << "/F";
args << "/IM testApp.exe";
QProcess::execute("taskkill", args); //Should be 'taskkill /IM testApp.exe /F'
輸出(從德語翻譯):
ERROR: Invalid argument - "/IM testApp.exe".
Type "TASKKILL /?" to show the syntax.
uj5u.com熱心網友回復:
"/IM testApp.exe" 生成一個引數,但應該是兩個引數。你得到了命令taskkill /F "/IM testApp.exe"。正確的呼叫是
QStringList args;
args << "/F";
args << "/IM";
args << "testApp.exe";
QProcess::execute("taskkill", args);
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/362758.html
