F
for.fun
Hi everybody,
I have the following problem :
Consider the following "test.cmd" command script :
test.cmd:
REM ----------------------
MyChildProcess.exe
REM ----------------------
(where "MyChildProcess.exe" is just a never-ending application suitable
for my test)
When I kill the "test.cmd" (using the Windows task manager or any
Windows kill tool), my "test.cmd" process is correctly killed but
"MyChildProcess.exe" stays alive (and I suppose it becomes a system's
child because its parent died)
What I would like to do is : killing the "test.cmd" (cmd.exe) also kill
"MyChildProcess.exe"
(I am running "MyChildProcess.exe" as a service using "SrvAny.exe" and
the "NET STOP" command only send a stop signal to the "test.cmd" shell
script and leave the "MyChildProcess.exe" running)
Under Unix, this behavior is achevied with the "exec" command => the
child process becomes a part of the parent process so both of them die
when one of them receive a kill signal.
=> Does anybody know is the same feature as "exec" exist under Windows
?
=> If no, is there a way to modify the "test.cmd" shell script so both
parent and child can be killed on the same time ?
Thanks in advance for your help.
I have the following problem :
Consider the following "test.cmd" command script :
test.cmd:
REM ----------------------
MyChildProcess.exe
REM ----------------------
(where "MyChildProcess.exe" is just a never-ending application suitable
for my test)
When I kill the "test.cmd" (using the Windows task manager or any
Windows kill tool), my "test.cmd" process is correctly killed but
"MyChildProcess.exe" stays alive (and I suppose it becomes a system's
child because its parent died)
What I would like to do is : killing the "test.cmd" (cmd.exe) also kill
"MyChildProcess.exe"
(I am running "MyChildProcess.exe" as a service using "SrvAny.exe" and
the "NET STOP" command only send a stop signal to the "test.cmd" shell
script and leave the "MyChildProcess.exe" running)
Under Unix, this behavior is achevied with the "exec" command => the
child process becomes a part of the parent process so both of them die
when one of them receive a kill signal.
=> Does anybody know is the same feature as "exec" exist under Windows
?
=> If no, is there a way to modify the "test.cmd" shell script so both
parent and child can be killed on the same time ?
Thanks in advance for your help.