QProcess won't start executable on Windows
-
Hi, so I have a problem with QProcess, because it doesn't want to start an executable.
I've checked paths, tried multiple things, but nothing worked so far...
Here's what I have right now:#include <QCoreApplication> #include <QProcess> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QProcess startServer; startServer.setWorkingDirectory("C:/Users/janso/Desktop/more/WSL_GUI"); startServer.start("cmd /C", QStringList("Window.xlaunch")); startServer.waitForFinished(); qDebug() << startServer.readAll(); //prints "" }
No output whatsoever.
-
@Sucharek said in QProcess won't start executable on Windows:
"cmd /C"
This is wrong - there is no command
cmd /C
, just a commandcmd
which takes/C
as first argument./edit: and if
Window.xlaunch
is really a executable then there is no need to execute it throughcmd
at all - it should be started directly then instead. -
Hi
You seem not to point to an exe for it to execute ?what is Window.xlaunch ?
-
@Sucharek said in QProcess won't start executable on Windows:
"cmd /C"
This is wrong - there is no command
cmd /C
, just a commandcmd
which takes/C
as first argument./edit: and if
Window.xlaunch
is really a executable then there is no need to execute it throughcmd
at all - it should be started directly then instead.Hi @Christian-Ehrlicher, that solved it. Thank you :)