I have set up Task Scheduler to execute batch programs using a programming language known as SAS. Normally things work properly, the task ends as expected, and a log file is created.
Today, the task ended unexpectedly (actually, I know why, I set the task to end after 30 minutes, because the task shouldn't take more than about 2 minutes). The problem is that the log file that is being written by this program is now locked, and I cannot delete it or move it edit it. Other files used in this task have the same problem. If I try to delete it, I get the Windows message that says: "The action can't be completed because the file is open in SAS" (even though SAS is no longer open because the task has ended). This is completely repeatable, this has happened several times now, with identical results.
So, to be clear, my concern is not that the task ends unexpectedly. My concern is that I cannot edit or delete or move the log file, nor can I edit or delete or move any of the other files in use by the program.
Please advise.