i want to run a bacth file from QT, currently i have code something like given below. i want to run on cmd is somthing like
startup.bat -arg1=abc -arg2=abc1 -arg2=abc3 -arg4=abc4
how do i run the batch file with arguments? any help will be appriciated




Qt Code:
  1. void MainWindow::on_Button_Go_clicked()
  2. {
  3. QProcess cmd;
  4. const QString myProc = "cmd.exe /c startup.bat " + MainWindow::getWorkingConfiguration(); QString sOldPath = QDir::currentPath();
  5. QString myPath= MainWindow::getWorkingDirectory();
  6. QDir::setCurrent( myPath );
  7.  
  8. //Run it!
  9. cmd.startDetached(myProc);
  10. qDebug(myPath.toStdString().c_str());
  11.  
  12. QDir::setCurrent( sOldPath );
  13. }
To copy to clipboard, switch view to plain text mode