close/kill another Windows process which is started by run a .bat in Qt app
-
You can run this command without cmd.exe, that's my point...
-
@jsulm With the help of GStreamer Library?
-
No.
process->start("gst-launch-1.0", QStringList() << HERE_PUT_THE_PARAMETERS_AS_LIST);
-
@jsulm With the help of GStreamer Library?
@Vijaykarthikeyan
Don't understand. @jsulm is just asking why you usecmd /c ...
at all? Use QProcess::startCommand() directly on your string starting with"gst-launch-1.0 ..."
. Then you don't have acmd
process and agst-launch-1.0
one to deal with.@jsulm
The user probably doesn't want to split his string into lots of separate arguments to pass tostart()
:) That's why I suggest he might want to usestartCommand()
. -
@Vijaykarthikeyan
Don't understand. @jsulm is just asking why you usecmd /c ...
at all? Use QProcess::startCommand() directly on your string starting with"gst-launch-1.0 ..."
. Then you don't have acmd
process and agst-launch-1.0
one to deal with.@jsulm
The user probably doesn't want to split his string into lots of separate arguments to pass tostart()
:) That's why I suggest he might want to usestartCommand()
.@JonB Oh..sorry..actually..I dont know about startcommand() until now..I'll try it and feedback you
-
@Vijaykarthikeyan
Don't understand. @jsulm is just asking why you usecmd /c ...
at all? Use QProcess::startCommand() directly on your string starting with"gst-launch-1.0 ..."
. Then you don't have acmd
process and agst-launch-1.0
one to deal with.@jsulm
The user probably doesn't want to split his string into lots of separate arguments to pass tostart()
:) That's why I suggest he might want to usestartCommand()
.@JonB Sorry to interrupt you..Just now gone throught that documentation,this startCommand() method is available for the Qt versions 6.x but I'm using 5.15.2.
that's why i didnt know about this command
-
Always helps if you tells which version you are using for any question!
To use
start()
then (withoutcmd /c
) you must chop your line up into separate arguments at every (non-embedded) space. probably including each of those!
which are being used as "pipes" on the command passed togst-launch-1.0
. Do so manually in code source, or maybe useQString::split()
on space if you want. I think QStringList QProcess::splitCommand(QStringView command) is available to you in 5.15. [Yes, it was introduced at 5.15 if you want to use it.] -
Always helps if you tells which version you are using for any question!
To use
start()
then (withoutcmd /c
) you must chop your line up into separate arguments at every (non-embedded) space. probably including each of those!
which are being used as "pipes" on the command passed togst-launch-1.0
. Do so manually in code source, or maybe useQString::split()
on space if you want. I think QStringList QProcess::splitCommand(QStringView command) is available to you in 5.15. [Yes, it was introduced at 5.15 if you want to use it.]@JonB Ok..Running..But..when process->kill() executed..it is not closing that process.Why? How to close it by process->processId()
-
Why? I don't know.
Windows/DOS has ataskkill <pid>
command, I believe. You could issue that via anotherQProcess
(try it first from command line). I don't know if that will work whenQProcess::kill()
does not. I do not know whethergst-launch-1.0
is itself a "wrapper" for spawning other processes. -
Why? I don't know.
Windows/DOS has ataskkill <pid>
command, I believe. You could issue that via anotherQProcess
(try it first from command line). I don't know if that will work whenQProcess::kill()
does not. I do not know whethergst-launch-1.0
is itself a "wrapper" for spawning other processes.@JonB ok..understand..Can you please calrify one thing.. Will terminatinf the QProcess will terminate the process pointer or the process which is triggered by the QProcess?
-
@JonB ok..understand..Can you please calrify one thing.. Will terminatinf the QProcess will terminate the process pointer or the process which is triggered by the QProcess?
@Vijaykarthikeyan It should
deleteterminate the process created on theQProcess
object, i.e. just what you would expect.