views:

1835

answers:

5

Sometimes you cannot delete a file that is used by some other process in Windows. Error can be something like "sharing violation".

Is there any way to determine which process is holding a file?

Is there any utility that can do that (I can use utility call in a program) or is there any other way to get that information?

+7  A: 

Use Process Explorer and search for the handle.

Ed Guiness
+3  A: 

WhoLockMe.

JesperE
+5  A: 

Sysinternals Handle can help.

raven
Process Explorer and WhoLockMe are good also, but this one is console type application, so its output can be processed. I personally choose this one.
Sasha Yanovets
A: 

You don't need any tool. Just do it with Win32 N. Apis. (10 minutes to write it in C...)

Could you provide a link to documentation on that part of Win32 API?
Sasha Yanovets
+1  A: 

Unlocker might become your savior. :)

tedbundyjr