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

no prescription generic maxalt maxalt generic sale purchase cheap prescription Premarin buy Premarin in the uk Cytotec price buy herbal Activ8 Energy Booster Valtrex with no perscription and delivered over night purchase Maxalt without a prescription online buy Activ8 tablets without rx Activ8 pharmacy purchase Requip online no membership Maxalt purchase online how to buy Amitriptyline without a prescription Amitriptyline in usa buy Nizoral no prescription low cost order no online rx Orlistat purchase xenical without prescription to ship overnight buy Amitriptyline online pills purchase online prescription Amitriptyline Overnight Requip without a perscription order rx free Nizoral buy cheap Nizoral uk Amitriptyline generic where to purchase Amitriptyline no prescription no fees buy Nizoral on line amex cheap Nizoral uk buy Orlistat c o d cheap Premarin usa Premarin without rx buy no online rx Prozac Premarin buy online purchase Premarin without purchasing Maxalt online without prescription canada Proscar Proscar order i want to buy Proscar without a perscription buy brand Prednisone buy Requip 1 mg buy cheapest Lisinoprilbuy no prior prescription Lisinopril purchase Arimidex cod overnight delivery Canadian arimidex cheap purchase Maxalt buy discount Anafranil Endep with free fedex overnight buy Endep fed ex buy generic Endep from india buy Maxalt with american express Amitriptyline online purchase order online Famvir without prescription free fedex delivery Famvir where to buy Famvir no prescription no fees Aricept buy online purchase Aricept without prescription pay cod uk Aricept Aricept buy on line Nizoral without a perscription Nizoral fedex shipping order Nizoral order amex order Endep online buy Endep Online buy Endep us Amitriptyline canada canadian prescriptions Endep buy Endep amex online without rx buy Amitriptyline doctor prescription online Amitriptyline purchase buy Accutane 40 mg on line Canadian 40 mg Accutane diet pills without a perscription buy Activ8 Energy Booster with amex buy genuine Aldactone maxalt shipped by cash on delivery buy Maxalt online no rx order Prednisone online Lisinopril and dexamethasone arimidex with no r x and free shipping buy cheap Anafranil under without rx buy Famvir overnight delivery el Aricept generico buy Aricept overnight where to purchase generic Nizoral online without a rx cheap Endep uk Accutane 40 mg purchase 40 mg Accutane online perscription canadian generic Activ8 no prescription Activ8 generic buy cheapest Nizoralbuy no prior prescription Nizoral
© 2012 Geeky Ninja. All rights reserved.
Proudly designed by Theme Junkie.