If you want to unlock files in Windows many of us know to use Unlocker. It’s a handy tool that I use often when a pesky process has a handle on a file. But what if you want to write a script that unlocks files from the command line. Welcome the tool “Handle” from Sysinternals by Mark Russinovich.
Then you could loop through the list of files by doing so.