Hi,

I have a issue in setting the QProcess to run executable with the arguments. The Qt code for the same is as below,

Qt Code:
  1. QProcess* processSQLDB = new QProcess(this);
  2.  
  3. // some path where i require the output
  4. processSQLDB->setWorkingDirectory(sToolAccessfilepath);
  5.  
  6. QString sExeName = "\"D:/app 1/app.exe\"";
  7.  
  8. sArgs << "DBFile.db";
  9. sArgs << "<";
  10. sArgs << sDataFileName;
  11.  
  12. processSQLDB->start( sExeName , sArgs);
  13.  
  14. if (!processSQLDB->waitForStarted())
  15. return false;
  16.  
  17. // to display stdout, stderr,this gives an empty string
  18. qDebug() << processSQLDB->readAll();
To copy to clipboard, switch view to plain text mode 

The output of this snippet is the creation of the file "DBFile.db". But it is not happening. Am i doing any mistake?

But if i goto cmd prompt and execute the same thing like.,

c:/> "D:/app 1/app.exe" DBFile.db < sDataFileName. This works perfectly.