If the file is locked, the move command will give you an error indicating, "The process cannot access the file because it is being used by another process" and indicate that zero files were moved. You would need to test if the indicated 'write operation' locks the file or not. For example Excel locks a spreadsheet file when opening, but Notepad doesn't lock a text file when opening.
|