Sometimes you need to remove a locked file in a windows environment, and this should do the trick:
Open Administrative Tools -> Share and Storage Management -> Actions -> Manage Open Files
Here you are able to see all locked files and folders on this server. To clear a lock, select the relevant file and click “Close Selected”. Note that this should only be done if the user definitely is not using the the file, otherwise data loss may occur.