I have a VC job that initially runs a list against a directory path to determine the specific directories that have other files ready to be processed. Once these are identified, there is a loop through the files found in the folder so a new name can be determined and those files saved to a new location. That all works, but as the final part of the process, i attempt to rename the original source location - adding a suffix of "-finished" to the folder name. Those folders are excluded from future list functions.
The rename process can succeed, but if the task attempts to run when someone has left the folder open in Windows explorer (on a different computer), the folder rename task fails with an exception (access to the folder path is denied).
Prior to the rename folder task, is there anything i can do to sever any open connections to the folder that would prevent the task from succeeding.
I wanted to rename the folder so its easy to see that the folder has been finished. I could put a file in the folder to identify completion too, but it would be easier for the end-user to see completed folders at the directory level.