Is there a way to force/manage file locking in windows?

1

I have a 2 Windows machines networked and I am having trouble with simultaneous access to files. I would like only one user to be able to open a file at a time, which I thought was automatic, using file locks.... if the program used to access the file is locking the file.

I believe the problem I am having is some of the programs I use, don't lock the file, and there for can be modified simultaneously by multiple users, which is very much not desired.

Currently I am having this problem with only two computers, although as soon as I can figure out a solution to this problem the network is going to be expanded to 6 computers, which will include Windows 7, Vista, and XP, as well as a central file server (Samba).

Is there a way to ensure that all files opened in windows get locked? I have considered some sort of version control system, but all of the ones I have looked at are way too complicated. All I need is to ensure that multiple users can't write to a file at the same time.

Any suggestions are appreciated, thanks in advance.

EDIT:

The suggestions are appreciated, although here are some guidelines I was hoping to fulfill.

  • There is a large number of files and directories that are going to be shared, which will be served by a Samba file server. So managing share access with windows sharing won't be possible.

  • Multiple people need to be able to access a given folder simultaneously.

  • Samba supports file locking, so ideally I would like to force windows to place locks on files, even when the program being used normally wouldn't do so. (Is there a program that can do this?)

jpetersen

Posted 2012-06-18T19:16:18.630

Reputation: 83

Answers

1

You could create a shared folder and allow only one connection

enter image description here

Remus Rigo

Posted 2012-06-18T19:16:18.630

Reputation: 2 623

This does not apply to a samba server. It anyway allows only one user on the whole share. – harrymc – 2012-07-02T06:09:42.450

0

The most office files accept modifying on network. You should look at share options. For exe files and folders there are no simple ways. You could organize user files in folders visible only for owner+admin there is well knowm microsoft utility to hide/unhide folders in xp/2003? Other way is organize libraries in 7 for users may it help?

Yurij73

Posted 2012-06-18T19:16:18.630

Reputation: 800

1UNLOCKER doesn't seem to help me to lock anything, although I am sure it will be helpful once I get the file locks working. I don't need to lock any .exe files or folders. The share options is a good idea, but unfortunately that won't work once I start using the file server. Thanks for the suggestions! – jpetersen – 2012-06-18T20:00:07.740

0

Since this is a samba server, you could try to set the share to strict locking.

This option denies access to an entire file if any byte-range lock exists in it.

For more info see Using Samba : Locks and Oplocks.

harrymc

Posted 2012-06-18T19:16:18.630

Reputation: 306 093

Thanks, although that doesn't seem to have any effect on the programs that don't use file locks – jpetersen – 2012-07-04T22:18:25.637

Which programs don't use file locks? – harrymc – 2012-07-05T05:27:13.987

We use a CAD/CAM program called Vector, that doesn't seem to use them. – jpetersen – 2012-07-05T16:15:30.617