tags:

views:

31

answers:

4

When I delete a file that's being used by some process I get the access denied error saying that the file cannot be deleted as it is currently in use. Is there a way I can find out which process exactly is using that file in WINDOWS?

+1  A: 

I assume that you're using Windows. Unlocker is a great tool for this.

Lekensteyn
+1  A: 

You can use process explorer tool to find it out. I use this http://windowsxp.mvps.org/processlock.htm

ckv
Thanks. I was able to find the process that was using the file using process explorer. Thanks.
Abi
+1  A: 

In Windows you can use handle.exe by Sysinternals:

handle <name of file>

http://technet.microsoft.com/en-us/sysinternals/default.aspx

In Linux you can use lsof

onof
Thanks for the response. I guess Handle is similar to process explorer. I was able to use it.
Abi
handle is a command line tool: it tells you the pid of the processes handling that file, so you can kill it with pskill.
onof
A: 

A combination of fuser and /proc should work for linux/unix:

fuser - identify processes using files or sockets

ennuikiller
Hey Thanks for the response. I was looking for a solution for windows OS. Thanks anyway.
Abi