Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

Not that I'm aware of. I usually use Process Explorer to find the handle: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

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

share|improve this answer
add comment

Your Answer

 
discard

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