I have a task that runs a .bat file to ftp files from one server to another. It writes events to the Event log about the progress of the job. The last event it writes is "Job Completed SUCCESSFULLY".
Following are the last lines of the .bat file.
eventcreate /t information /id 107 /l application /d "%3.zip Get DB Backup Job Completed SUCCESSFULLY."
net use %1: /delete
The problem is that even though the processing of the bat file completes, the job status in Task Scheduler shows running and the next night when the task should run, it doesn't launch because its status is still Running.
I am thinking about changing the trigger to end job if runs longer than 8 hours, but was wondering if anyone has seen this type of issue before. The job runs under a local ID with admin privileges. Sometimes it runs fine and ends other times it remains in a running status until I end it manually.