We've got 2 tasks setup on one of our server to send data to one of our partners. Frequently when task runs it completes with a last result code of 0x0 (sucessful) but the process it calls (through a batch file) continues to run after the task ends. This then causes a problem when it runs again and it generates errors about the fact that the process is already running, checked task manager and indeed it is.
I've spoken to the vendor of the app (who is also the partner we are sending data to) and they have asked me to change the "stop the task if it runs for x hours x miniutes" to 15 minutes. I don't think the problem is related to the task scheduler but I'm wondering if anybody else has seen something like this happen just incase it is a windows bug of some sort.
is the batch file just launching an exe file? If so, I'd guess the batch file is terminating pretty much immediately but the exe is left running. If this is the case then even setting the "stop task if it runs for more than 15 minutes" won't help - I'm pretty sure that task scheduler will look to kill the batch file, not the process it spawned.
If you just run the exe file, does it quit cleanly once it's done its work? If not, then that's the problem and that needs to be fixed (eg If the exe file does its stuff but then just sits there waiting for someone to click "exit")
You could probably use pskill at the start of the batch file - eg if the process is called mytask.exe then you would have something like:
Code:pskill mytask.exe rem do more stuff rem now launch app mytask.exe
There are currently 1 users browsing this thread. (0 members and 1 guests)