Error in processing command in QProcess

450 views Asked by At

I am trying to execute following command and trying to get the output however I am getting output as null.

    QProcess process;
    process.start("cmd /c \"ipconfig\"");
    process.waitForFinished(-1);
    QByteArray out = process.readAll();
    QString testStr = QString::fromUtf8(out);

Can someone please tell me where am I doing wrong?

1

There are 1 answers

2
Edward On
process.start("C:\\Windows\\System32\\cmd.exe /c \"ipconfig\"");