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.

I see that a file has a lock on it. How could I find out the cause and root of this?

share|improve this question
2  
Is this a network file? Local File? What version of Windows? –  GregD Aug 24 '10 at 13:33

5 Answers 5

up vote 7 down vote accepted

Unlocker is a freeware utility that I have used many times for this purpose. Easy to use, right click on the file in question and it shows you which processes are locking it. You can then either kill those processes or forceably unlock all or one of the locking processes.

http://www.emptyloop.com/unlocker/

share|improve this answer
    
It can also delete corrupted files. Nice! –  Arthur Nunes Nov 30 '12 at 18:18

Try the Process Explorer tool from Sysinternals. Also their Handle tool is a command line tool to find out what has a lock on something.

share|improve this answer
    
Ah, yes, Process Explorer. –  MattUebel Aug 24 '10 at 14:38

From START > RUN type in "fsmgmt.msc" without the quotes.

This is the shared folders MMC and you can manage sessions here to see who has locks on particular files.

Edited to add:

You can also connect to your server (or another computer) with this snap-in by clicking on Action > Connect to another computer. You'll have to connect to the computer that the file exists on.

share|improve this answer
1  
+1 You might need to run this on the file server itself and not just the client computer –  jftuga Aug 24 '10 at 13:47
    
Thanks jftuga. I added that to my answer. –  GregD Aug 24 '10 at 14:11

Use ProcessExplorer from sysinternals. Search for the locked file and you'll easily see the process that has a reference to it in the list of handles (the bottom pane):

Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded.

share|improve this answer

You can use 'net file' via the Command Prompt onto the file server .

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.