Just in case someone looking for a solution to this for a Windows based system or NAS:
There is a built-in function in Windows that shows you what files on the local computer are open/locked by remote computer (which has the file open through a file share):
- Select “Manage Computer” (Open “Computer Management”)
- click “Shared Folders”
- choose “Open Files”
There you can even close the file forcefully.