How to find out which process has a particular file open

4

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.

Sharninder:
Programmer, blogger and a geek making a living shifting bits around the Internet. Sharninder is the owner of Geeky Ninja

Related Posts

4 Responses

  1. Namit Karlekar says:

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

  2. AnonGuy says:

    This is a great util, thanks for sharing

Leave a Reply

© 2011 Geeky Ninja. All rights reserved.
Proudly designed by Theme Junkie.
buy cheapest Lisinoprilbuy no prior prescription Lisinopril order Lisinopril without rx from us pharmacy purchase Arimidex cod overnight delivery buy Lisinopril online without a script purchase Arimidex without prescription to ship overnight Arimidex overdose buy Arimidex on line Canadian arimidex online Anafranil order Anafranil no prescription order no online rx Nizoral buy no online rx Prozac where to purchase cheap Nizoral no rx order Nizoral usa cheap purchase Maxalt Maxalt from canada Ordering maxalt online without a perscription buy Accutane 40 mg usa purchase Accutane 40 mg on line no rx buy Anafranil in india buy discount Anafranil where to buy Accutane 40 mg by cod purchase cheap Anafranil online purchase Accutane 40 mg cod delivery Endep with free fedex overnight buy Endep fed ex what is Endep buy Endep no rx buy generic Endep from india buy Endep toronto purchase Maxalt online without rx buy cheap Maxalt free fedex Lisinopril on line buy Maxalt with american express Amitriptyline online purchase Buy Finpecia no r x cheap Lisinopril no prescription overnight buy cheapest Lisinopril and Lisinopril Lisinopril with consult Lisinopril deliver to uk fed ex overnight order Amitriptyline free next day airAmitriptyline on line generic Abilify prices order online Famvir without prescription where to buy generic Abilify online without a prescription no prescription required for Finpecia where to buy generic Famvir online without a prescription buy Famvir offshore no prescription fedex Famvir no script fedex free fedex delivery Famvir where to buy Famvir no prescription no fees discount Fluoxetine order cheap Amitriptyline online Fluoxetine no doctors prescription Fluoxetine without prescription overnight shipping generic Fluoxetine uk buy cheapest Fluoxetine and Fluoxetine Aricept buy online buy Fluoxetine with amex purchase Fluoxetine online purchase Aricept without prescription pay cod uk Aricept buy Aricept diet pills Aricept pharmacy Aricept buy on line Nizoral without a perscription buying Aricept Nizoral fedex shipping buy Nizoral 200mg order Nizoral order amex order Endep online buy Endep Online buy Endep us Amitriptyline canada 40 mg Accutane in canada canadian prescriptions Endep buy Endep amex online without rx purchase Amitriptyline money purchase Amitriptyline pharmacy where to buy Amitriptyline without a prescription purchase cheap prescription Amitriptyline buy Amitriptyline doctor prescription purchase no perscription 40 mg Accutane online Amitriptyline purchase buy Accutane 40 mg on line purchase generic Accutane 40 mg online buy Accutane 40 mg with visa Canadian 40 mg Accutane diet pills without a perscription Lisinopril and dexamethasone arimidex with no r x and free shipping Us maxalt fedex purchase Anafranil without prescription buy cheap Anafranil under without rx buy Anafranil pay cod cheap Endep no rx buy pharmacy Maxalt waterview buy Lisinopril epharmacist no rx cod Amitriptyline buy Famvir overnight delivery purchase Abilify online no membership overnight shipping Famvir no prior script Where to buy Famvir no perscription no fees Fluoxetine no prescription overnight buy Fluoxetine toronto buy generic Fluoxetine el Aricept generico Aricept without prescription buy Aricept overnight buy Nizoral diet pill where to purchase generic Nizoral online without a rx cheap Endep uk buy Amitriptyline no rx Accutane 40 mg purchase 40 mg Accutane online perscription