Skip to content
  • Home
  • About
  • Contact
« uQuery: A better search engine for the Apple App store
How to read HFS+ volumes on Windows »

How to find out which process has a particular file open

By Sharninder | Published: September 16, 2009

Process ExplorerEver tried deleting, moving or renaming a file and got a terse message from Windows saying, you can’t ! With the reason being that the said file is in use by another process !

If you’ve ever been faced with one of those “Cannot delete a file because it is in use by another program” dialogue boxes, you’ll know how frustrating that can be.

The fact that you’ve closed every other program running on the system and still you get that message is even more annoying. So much for multitasking !

Windows, like all operating system, has no control over who requests to open a file. And when an application closes, it assumes that it’ll close and release control over all the files it opened. That sometimes doesn’t work. If an application crashes midway, or because of a bug forgets to close a file that it opened for use, Windows continues to assume that the file is still open by that application. And so if you go on to delete, move or do anything destructive with that file, you get this dreaded message.

Process Explorer

The problem is that Windows, by default, does not come bundled with any utility to help you overcome this problem. Although someone at Microsoft did recognize the need for such a tool and released the excellent Sysinternals Process Explorer.

Process explorer is a full featured replacement for the simple Task manager that is bundled with Windows. It, not only gives you much more info about the processes running on your system, it also gives you much more visibility into what exactly is each process doing, how many resources it is consuming and what other resources does it depend on.

Process Explorer

Among, the many properties of an application that Process Explorer displays, the one that is most useful to us is the ability to display the open file handles.

Under Windows, whenever an application wants to access or open a file, it does so using something called a File handle, which is nothing but a pointer to the particular file in the memory. When an application crashes, hangs or is unable to close the file handle that it opened, users start getting the File in Use message (when they try to access that file, of course).

Now, we’ll see how, using Process Explorer, we can find out out which process has a particular file open and how we can force the application to close it.

Click on Find->Find Handle or DLL or press CTRL+F.

Enter the name of the file that you’re trying to open and click on Search.

Process Explorer

Process Explorer will display the the name of the process that has the file opened. Click on it, and it’ll highlight the process and the open handle in the main window. Click on Cancel and go to the main Window.

Right click on the Handle name and select Close Handle.

Process Explorer - Close Handle

Voila ! You should now be able to delete the particular, modify it or do whatever it is that Windows was preventing you from doing with it.

SysInternal Process Explorer is a free download and is, in my opinion, one of those extremely useful tools that should be present on every Windows install.

About Sharninder:

Programmer, blogger and a geek making a living shifting bits around the Internet. Sharninder is the owner of Geeky Ninja
Related Posts with Thumbnails
  • PrintFriendly
  • Yahoo Buzz
  • Google Reader
  • Delicious
  • Evernote
  • LinkedIn
  • StumbleUpon
  • Tumblr
  • Identi.ca
  • Digg
  • Facebook
  • FriendFeed
  • Reddit
  • Technorati Favorites
  • Twitter
  • Share/Bookmark

Related Posts

  • Auslogics Disk Defrag – A fast and free Disk Defragmentation utility
  • How to read HFS+ volumes on Windows
  • Caffeine keeps your PC awake
  • How To Get Music Off your iPod
  • Windows 101: Add a New User Account in Windows 7
This entry was posted in Windows and tagged process explorer, sysinternals, system tool, utility, Windows. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
« uQuery: A better search engine for the Apple App store
How to read HFS+ volumes on Windows »

2 Comments

  1. Namit Karlekar
    Posted September 17, 2009 at 8:11 am | Permalink

    You can also use this small lil tool called unlocker…. Just right click on the file and “Unlock”…

    Reply
    • Sharninder
      Posted September 17, 2009 at 9:08 am | Permalink

      @Namit: I’m guessing you’re talking about this. Unlocker looks like a pretty good no-nonsense utility.

      Reply

One Trackback

  1. By Come scoprire il processo che ha un particolare file aperto | 3 sul Blog - Tech, Fun e Web 2.0 on October 28, 2009 at 2:31 pm

    [...] [geekyninja] Ti piace questo post? Allora [...]

Post a Comment

Click here to cancel reply.

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

  • Subscription Options:

  • Recent Posts

    • How to add Facebook chat to iChat on Mac OS X
    • How To Get Music Off your iPhone
    • Monitor your websites for free using WasitUp?
    • Grooveshark: Listen to unlimited music online for Free
    • Glide OS – A web based free operating system
    • December Roundup – Best of the Web
    • HowTo install RockBox on your iPod
  • Recent Comments

    • How To Get Music Off your iPhone | Geeky Ninja on How To Get Music Off your iPod
    • Sharninder on Grooveshark: Listen to unlimited music online for Free
    • Briefgold on Grooveshark: Listen to unlimited music online for Free
    • Matjaz on Recover data from an iPhone backup
    • Simon on Recover data from an iPhone backup
  • Most Popular Posts

    1. 3%HowTo install RockBox on your iPod
    2. 2%Grooveshark: Listen to unlimited music online for Free
    3. 2%Glide OS - A web based free operating system
    4. 2%Want to see what the Google Wave Hype is all about ? We've got invites for you
    5. 2%Find the cheapest books on Amazon using CheapRiver
    6. 2%Monitor your websites for free using WasitUp?
    7. 1%December Roundup - Best of the Web
    8. 1%How To Get Music Off your iPhone
    9. 1%How to add Facebook chat to iChat on Mac OS X
  • Categories

    • Announcements
    • Firefox
    • Internet
    • iphone
    • Linux
    • Mac OS X
    • Open Source
    • Tips and tricks
    • Useful Utilities
    • WebApps
    • Windows
  • Archives

    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
Powered by WordPress.