If you need to delete a resource but it is locked by a process and you don't know which process it is, then use
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Process explorer tool , and use the Find menu , entering the name of the locked resource (file, directory)