Why not run each command seperately? It would be much easier. For example, 'dir' command can be run like:
Qt Code:
  1. p.start("cmd.exe", QStringList() << "/c" << "dir");
  2. if (p.waitForStarted())
  3. {
  4. p.waitForFinished();
  5. qDebug() << p.readAllStandardOutput();
  6. }
To copy to clipboard, switch view to plain text mode