That raises some interesting questions, such as why are you
killing a.cmd vs. letting it finish it's run? I assume since it's a
scheduler, you're killing it at the end of the process window. But killing
a cmd is not going to kill the child process. A cmd is about the same as a
bat file: it's can call the other commands asynchronously and they can spawn
separate from the cmd parent.
What you probably want to do is enumerate the processes
under a.cmd and kill those first. Walk up the tree rather than lopping the
top off as it were. You can see what the tree looks like with tlist -t
Taskkill? New to me. Kill.exe is a reskit
utility that can be used. Kill.exe pid -f is what usually works, but
not always depending on the app.
More background on the kill concept: http://msdn.microsoft.com/library/default.asp?url="">
From: Baekelant, Erik [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 8:52 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [ActiveDir] OT: batch/command file and "child-processes" kill ing
BTW,
I know I could use
taskkill /t
But the Scheduling
software uses a regular "kill" thing . . .
-----Original Message-----
From: Baekelant, Erik [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 2:29 PM
To: '[EMAIL PROTECTED]'
Subject: [ActiveDir] OT: batch/command file and "child-processes" killing
From: Baekelant, Erik [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 2:29 PM
To: '[EMAIL PROTECTED]'
Subject: [ActiveDir] OT: batch/command file and "child-processes" killing
Hello
First of all, apologies for going OT . . .
We are introducing our Scheduler software
(Client-side, CA Autosys) in the Windows environment.
Everything starts fine, except stopping/killing jobs.
Batch-file (a.cmd) calls another program (b.exe)....
a.cmd gets killed but b.exe keeps running.
It
is like (without using scheduler things) killing the batch and wanting the
"child-processes" to quit too.
Anyone any idea on how to execute b.exe from within a batch/command-file a.cmd ?
Much appreciated,
Erik
