How can I unlock a folder locked by ‘System’ process on Windows Server 2008?
It turns out this was caused by another computer that had an open explorer shell on the "problematic" computer. This problem persisted even after a reboot! (not at first, but it reappeared)
The only solution was to close the relevant explorer window from the other computer.
usually it is because the file is open via file sharing. You can close that in computer management GUI / Shared folders / Open Files or via command line
net file - lists all open files
net file id /close
UPDATE: this command might work better in some cases:
openfiles /query /fo csv /v > c:\temp\files.csv -then open files.csv and search in it-