0

Not sure whether I have the message above exactly correct but I run into this often. I try to use Windows to delete a directory or a file and it tells me I can't because the file is in use by another program. It doesn't say what process is using it.

Sometimes it is clear what is using it, but other times it is not. I open the Task manager and go through all the processes but nothing stands out.

Is there a way to determine what has a file open, and a solution (other than rebooting)?

I suppose most of the time it may be Eclipse related but certainly not all of the time.

Tony
  • 1,127
  • 1
  • 18
  • 29

2 Answers2

1

I use Process Explorer

Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded.


You can add the column like shown below (Window Title) and it should help you find the file you are looking for, and what is using it:

enter image description here

enter image description here


If you end up choosing to use this program instead of Task Manager, there is an option for that which will open this instead of Task Manager:

enter image description here


If you decide to "Replace Task Manager" and ever get stuck where you cannot 'undo' what you've done (Meaning, "The original Task Manager will no longer open")... You can modify the registry listed here and delete the Debugger entry. (In this example, I have this path to a network drive).

enter image description here

Brien Foss
  • 3,336
  • 3
  • 21
  • 31
  • Something we need to download and install? – Tony Feb 06 '18 at 16:47
  • Maybe our IT department wouldn't freak then as long as it doesn't need admin privileges? – Tony Feb 06 '18 at 17:59
  • I downloaded. Which column do I add to show the files? I can't see your headers – Tony Feb 06 '18 at 18:27
  • @Tony did this work for you? If I sufficiently answered your question, please mark my answer :) – Brien Foss Feb 09 '18 at 23:59
  • My apologies. It kind of works. It is hard to go through what it shows open. Sometimes it lists dozens of applications. When I try to use it again it freeze and I have to restart it. I guess I need to play around with it some more? – Tony Feb 26 '18 at 16:24
  • @Tony well it is a representation of what is running so it is going to display a lot of applications if you have a lot running. I agree it is a bit painful to look through but you can also use the `Find` menu option too to assist. Thank you for returning to this Q&A – Brien Foss Feb 26 '18 at 16:26
0

I had this problem in Excel, where some files would be active, but not visible to me, either on my screen or in the task manager. The way I solved it was to use the command prompt to kill the task:

  1. Open command prompt (type cmd in windows search at the bottom left of your screen)
  2. Type "tasklist"
  3. Find the task you want to terminate (for me it was EXCEL.EXE)
  4. End the task by either using the image name (type "taskkill /im EXCEL.EXE", or whatever program you want to end. This will kill all tasks with that image name) or using the ID (i.e. "taskill /pid 1234, or whatever ID the program has. This will kill that specific task)