Manage Learn to apply best practices and optimize your operations.

Utility helps unlock files that are in use

A tool called OpenedFilesView produces reports of opened files so administrators can unlock them.

This tip originally appeared on, a sister site of

Most administrators have at one time or another encountered a file that cannot be deleted or moved because it is in use.

About a year ago I wrote a tip about a utility called Unlocker, which can help you determine if a given file is in use by a given process, and help you unlock the file so it can be handled.

Another tool that does this is Nir Sofer's OpenedFilesView (OFV). Most other tools in this arena work by having you right-click on the offending file and unlocking the file from a context menu. OFV doesn't work with any one file at a time, but instead produces a report of all the opened file handles in the system. The results can be sorted by filename, full path, handle, file attributes, file permissions, and information about the process holding locks on the file. If you are working with programs that may be holding a slew of files open at once, this is an easy way to find out what's keeping what open.

Right-clicking on any of the entries in the report gives you a context menu. From there you can force the file handle in question to close, kill the process holding the file open, or create an HTML report of the selected items. The program itself can also be run with command-line parameters to create HTML, XML or delimited text file reports, and can automatically close specified file handles (or even all the files held open in a given folder).

The program has a few drawbacks. Filenames and paths in Unicode are not yet enumerated correctly; non-ASCII characters show up as question marks. OFV also cannot close any files held open by the Windows kernel, due the APIs used (and also because that would most likely contribute to system instability).

Note: OFV can close files held open by Explorer.exe. Just make sure any Explorer windows that might actually be showing the file are already shut.

Serdar Yegulalp is editor of the Windows Power Users Newsletter.

Dig Deeper on Small-business infrastructure and operations

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.