Guest AdamT Posted October 12, 2007 Posted October 12, 2007 Dear all, Is there a way to get the task scheduler to kill not just the task, but also the child processes? I have some scheduled tasks which run a .cmd file each night, and the task scheduler is configured to kill the task if it is still running 23 hours later. So far, so good - but the .cmd file calls another .exe file, which doesn't get killed when the instance of cmd.exe is. So I end up with a lot of processes like: Path: C:\Scripts\gzip.exe Parent: <Non-existent Process>(3336) User: NT AUTHORITY\SYSTEM State: Wait:WrLpcReply The process has some open file handles, so it hasn't finished running, but appears to be awaiting input from somewhere. Any pointers appreciated - I can't seem to find anything on MSDN, technet, etc...
Guest Pegasus \(MVP\) Posted October 12, 2007 Posted October 12, 2007 Re: Scheduled Tasks - Not Killing Child Processes "AdamT" <adwulf@gmail.com> wrote in message news:1192221575.500486.24810@e34g2000pro.googlegroups.com... > Dear all, > > Is there a way to get the task scheduler to kill not just the task, > but also the child processes? > > I have some scheduled tasks which run a .cmd file each night, and the > task scheduler is configured to kill the task if it is still running > 23 hours later. > > So far, so good - but the .cmd file calls another .exe file, which > doesn't get killed when the instance of cmd.exe is. > > So I end up with a lot of processes like: > > Path: C:\Scripts\gzip.exe > Parent: <Non-existent Process>(3336) > User: NT AUTHORITY\SYSTEM > State: Wait:WrLpcReply > > The process has some open file handles, so it hasn't finished running, > but appears to be awaiting input from somewhere. > > Any pointers appreciated - I can't seem to find anything on MSDN, > technet, etc... > Have a look at taskkill.exe /t, available under WinXP and possibly also under your unknown OS.
Recommended Posts