Windows: launching a new terminal (cmd.exe) from QProcess
How can I launch (and see) a new terminal through QProcess?
I can do something like this:
args << "/C" << workDir + updater_exe << "--install-path" << "../"; QProcess::startDetached("cmd", args, workDir)
And it works . In the background, so I never get to see the terminal and the messages that should be printed on it.
On a "cmd.exe" one may start another terminal by issuing the command "start cmd.exe". But I'm unable to do the same through QProcess. I can't start the program by using "start" preceding it.
maybe you should write a terminal widget yourself, and communicate with
cmd.exeto get the output and print in your widget?
or try to call the
the reason you can't "start cmd.exe" may be described in the document
@cidadao Did you try to start cmd.exe without /C?
@Flotisable The link you posted does not explain the problem as it is talking about commands which are built-in incmd.exe. cmd.exe itself is an executable and can be started using QProcess.
as far as I know,
startis a build-in command of
cmd.exe, so that's why I post the link.
@Flotisable Sorry, didn't notice start before cmd.exe
args << "/C" << "start" << workDir + updater_exe << "--install-path" << "../"; QProcess::startDetached("cmd", args, workDir);