I trying to run "net use \server_ip" and parse result. Platform - Windows
I have the following code:
QProcess *prc = new QProcess(0);
QString exec="net use";
QStringList params;
params << "\\\\" + getServerIP();
prc->start(exec,params);
qDebug() << "exec process";
prc->waitForFinished();
qDebug() << prc->readAll() << prc->exitStatus();;
delete connected;
But readAll() reurns "" and exitStatus() returns 0.
Do you guys have any suggestion?
"use"is actually the first parameter. The command isnet.exe- Ben VoigtQProcess::start- Ben VoigtQProcessuses signals to report failure instead of a return value. Doesn't change that you failed to check the result (result can mean return value, but it can also mean exception, output parameter, global errno, or in this case, a signal). - Ben Voigt