How do I lock a file for editing that's stored on a shared folder?

5,306

My question is how can i secure that the files that are in the shared folder open once a time so everytime only one user from the network can edit the specific file.

That's built-in by design. It's called opportunistic locking, see here: http://support.microsoft.com/kb/296264

By default, opportunistic locking is enabled for server message block (SMB) clients that run one of the Windows operating systems that is listed in the "Applies to" section. Opportunistic locking lets clients lock files and locally cache information without the risk of another user changing the file. This increases performance for many file operations but may decrease performance in other operations because the server that grants the opportunistic lock must manage the breaking of that lock when another user requests access to the file.

See also: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365433%28v=vs.85%29.aspx

Share:
5,306

Related videos on Youtube

Spiros
Author by

Spiros

Updated on September 18, 2022

Comments

  • Spiros
    Spiros almost 2 years

    I have installed a windows server 2008 r2 with file service enabled. I have a network with 5 computers with windows 7 and all are on the same workgroup (I do not have domain controller and active directory). All the computers can connect to the server and see the shared folder and the files.

    My question is how can i secure that the files that are in the shared folder open once a time so everytime only one user from the network can edit the specific file.

    Thanks in advance, Spiros

    • MichelZ
      MichelZ about 10 years
      What application? What files? The application should properly lock the files when they are not meant to be written by multiple persons
    • Spiros
      Spiros about 10 years
      Thanks for your quick response. Yes, that i am asking is how to put a write lock on these particular files (word, excel). Because non of these files have this security policy from the program side when they created i am trying now to configure it from the server side if it is enable.
    • MichelZ
      MichelZ about 10 years
      Word, Excel warn you about this when you open a file which another user already has opened. Is there an exact problem you try to solve? Did you have problems with this?
    • Spiros
      Spiros about 10 years
      oplocking was not enabled from server side. That was the problem. Thanks a lot everybody for your answers