Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes when I'm trying to delete a file, the system prompts me with the messsage

"Cannot Delete file. It is being used by another person or program."
"Close any programs that might be using the file and try again"

Well, sometimes it's easy to find the program, but sometimes not. In those cases I used the Unlocker third party program to unlock the file, but my question is:

Is there any CLI command or any way to find the process associated to a certain file in XP without using any third-party software?

Best to all,

share|improve this question

Sysinternals Handle is not really a 3rd party utility given that SysInternals are owned by Microsoft now and it has a much lighter install footprint.

There is a built in CLI utility called Openfiles that in its default config will tell you which files are being held open via inbound network sharing, it is possible to set a global flag ('maintain object list') which will allow this to track all locally opened files. Enabling this is simple, just enter the command below, but please note that changing that flag has a performance impact.

openfiles /Local on

You will have to restart the system for this to take effect.

share|improve this answer

Not that I'm aware of. I usually use Process Explorer to find the handle:

That utility, though not originally developed by a third party, is now owned by Microsoft.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.