Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Executing BAT file using Qprocess
-
when my bat files are located in C folder program working fine but when i moved bat file from windows C to E Qt fails to call bat file.
This is my program
QProcess process;
process.setProgram( "cmd.exe" );
process.setArguments( { "/C", R"(E:\Run.bat)" } );
process.setWorkingDirectory( R"(E:\ )" );
process.setStandardOutputFile( QProcess::nullDevice() );
process.setStandardErrorFile( QProcess::nullDevice() );
process.startDetached();
Please help to resolve..
-
Hi
You should check if it gives errorconnect(&process, &QProcess::errorOccurred, [=](QProcess::ProcessError error) { qDebug() << "error enum val = " << error; });
-
Sorry, issue has been resolved it just beacause path of file within bat file was wrong..Thank you @mrjj