Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not sure if I should be asking this here or on StackOverflow, but here goes:

I'm part of a team maintaining a document management application, and I'm trying to figure out Windows file locking permissions. We use a utility somebody downloaded years ago called psunlock to remotely close all locks on a file. We recently discovered that this does not work across different domains on our VPN. A little bit of digging lead me to the samba manual's discussion of file locking. I still don't really "get it", though.

Does anyone have any insight to share into how the process of locking and breaking locks on files works in a network context? My thinking is that privileges are required both on the file appliance and on the client workstations which hold locks. Is that accurate? Can anyone give a more specific version? Ideally I'm looking for something along the lines of A user must have privilege level X in order to break locks held from a client workstation. In practice I'd be happy with a hotlink to a good white paper on the subject.

share|improve this question

I've never tried forcibly unlocking a file with anything less than full admin rights and would expect that to be the the requirement. There is no requirement for the client end, as the lock must be removed on the machine on which the locked file resides and the other end, whether it's on the same machine or elsewhere on the network, is irrelevant.

When reading your question the first thing that came to my mind is that there should normally be very little need to do such things, yet you make it sound like a routine task. Might I suggest you worry less about how to unlock files and start investigating why the need exists at all?

share|improve this answer
The need exists because the program holding the lock does so even when opening a read-only copy of the file, and may hold locks to many different files simultaneously because the files reference one another. We need to allow multiple users to have the file open for read while allowing users to "check in" a new copy of the file to the main vault. Changing any of that is not an option. – Mike Burton Oct 30 '09 at 2:41
I suspect we may not be talking about the same thing. I'm referring to file system locks. The kind that prevent you from deleting a file even when it's not supposed to be in use. – John Gardeniers Oct 30 '09 at 3:50
I'm not terribly well educated about it, unfortunately, so you may well be right. I assume "lock" is the right word for the behaviour I'm talking about, but maybe it isn't. – Mike Burton Oct 30 '09 at 13:53

Your Answer


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.