I am copy and pasting a single large excel .XLSM file (12 MB) from one file server location to another, overwriting the file in the destination, however that operation fails because of "file in use", however it is not actually in use and the destination file can be deleted before the copy to make this copy and paste succeed. Whatever windows is doing in the background to scan the destination file prior to allowing the overwrite operation seems to take so long that the copy and paste comes up with a 'file in use' error and will not overwrite.
Update: I have isolated this to windows real-time protection on the local PC. Disabling it allows the file to be copied just fine.
Is there any way to stop this scanning by windows on this specific file only?
Solution: The solution was to add a group policy so that files in that specific folder with that extension are added to the exclusion list for security.