Windows: launching a new terminal (cmd.exe) from QProcess
-
Hello,
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.Any suggestions?
-
Hello,
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.Any suggestions?
@cidadao
maybe you should write a terminal widget yourself, and communicate withcmd.exe
to get the output and print in your widget?or try to call the
cmd.exe
bycmd.exe
?the reason you can't "start cmd.exe" may be described in the document
-
Hello,
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.Any suggestions?
@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. -
@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.@jsulm
as far as I know,start
is a build-in command ofcmd.exe
, so that's why I post the link. -
@jsulm
as far as I know,start
is a build-in command ofcmd.exe
, so that's why I post the link.@Flotisable Sorry, didn't notice start before cmd.exe
-
Hello,
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.Any suggestions?