How to Unlock Locked Files in Windows

Sometimes Windows can be really, really stingy. For whatever reason, some or other application on Windows may make reference to a particular file on your system which of course results in a locked file – great because it allows for integrity when working with files but not so great when the application stops using a file and Windows simply takes its damn time unlocking the thing again!

Luckily for us though, that clever guy Nir Sofer over at http://www.nirsoft.net came up with the clever little OpenedFilesView application that essentially lists all the currently “open” files on your system, displaying for each open file the handle value, the type of access (read/write/delete), file position as well as the process that opened the file amongst other things. This little app then allows you to essentially force close these open files by either closing the handle via its own interface or alternatively killing the process it indicates is currently locking that annoying file.

In other words, finally the end to annoying error messages like these:

  • Cannot delete [filename]: There has been a sharing violation. The source or destination file may be in use.
  • Cannot delete [filename]: It is being used by another person or program. Close any programs that might be using the file and try again.

(Of course, you should note that forcing an open file closed could be potentially unstable for your system – though if you’re actually using this application you are most likely a power user – hence you should know what you are doing or at the very least, know how to recover from a disastrous mistake! :P)

Related Link: http://www.nirsoft.net/utils/opened_files_view.html

You might also enjoy:

  • The simplest way to delete a file in PHP is to make use of the unlink function. 'Unlink function' you ask? Well the thought behind the name of the unlink fu ...
  • Windows XP has a nasty habit of locking corrupt or incomplete video files, and you’ll often find yourself screaming in frustration as your latest attempts t ...
  • If you've ever come across the problem of your Windows Explorer process falling over every time you right click on an executable (.exe) file in Vista or XP, ...
  • It's annoying when you pull down a really large file and then when you want to put it on your little flash drive you realize that the file is simply to larg ...
  • Just a simple code snippet to remind myself just how easy it is to spit out content into a text file using PHP. $myFile = "testFile.txt"; $fh = fopen($myF ...

About Craig Lotter

Craig Lotter is an established web developer and application programmer, with strong creative urges (which keep bursting out at the most inopportune moments) and a seemingly insatiable need to love all things animated. Living in the beautiful coastal town of Gordon's Bay in South Africa, he games, develops, takes in animated fare, trains under the Funakoshi karate style and for the most part, simply enjoys life with his amazing wife and daughter. Oh, and he draws ever now and then too.
This entry was posted in Software & Websites and tagged , , , , , , , , . Bookmark the permalink.
    blog comments powered by Disqus