Link to home
Start Free TrialLog in
Avatar of MNuttall
MNuttall

asked on

How to manage a single config file for multiple users?

Hi,

I´ve developed a VBS app which uses a text file for user´s config. The app is available to users from a NAS and they have access to update the config file to their needs.

A problem arises when users leave the config file in their text editor, just hitting save when they have made updates.  This can cause other users to lose their last updates as the file is reverted to a previous state.

I am looking for a solution whereby users can update their config without affecting others.  I thought maybe the way forward would be to provide a config app to update a non readable file, but this would lose the simplicity of a single readable config.  

Ideally the OS would mark the file as being edited therefore only 1 user at a time could update it at a time.  Whilst being updated the file must always be available in read only.  Similar to when trying to edit an Excel doc.

Any useful advice would be appreciated.

Thanks,

Matt
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> but this would lose the simplicity of a single readable config

I recommend giving up on that "simplicity", because trying to share a single config among multiple users actually makes things more complicated. The simplicity will come from each user having his own config file. There are choices of where to store each user's config file. Depending on the app, sometimes I'll put it in the folder where the app/script is, other times in the AppData folder (which the global variable %appdata% contains). Regards, Joe
Avatar of MNuttall
MNuttall

ASKER

Ok, I'll adopt a local config approach.
Many thanks for the quick response.
Joe, thanks for your comment. I would have shared the points but I'm new to this!
You're welcome...and don't worry about the points in this case. But the points are important to the experts, so it would behoove you to learn how to share the points. The basic technique is to click "Accept Multiple Solutions" on one of the answers and then assign point values to the multiple answers until they add up to the value of the question (such as 500 for this one). I'm sure you'll get the hang of it. And if you ever make a really bad mistake, such as accepting a post that you did not intend to accept, you can click the "Request Attention" link (under your original post on the right side) and ask for the question to be re-opened. An EE admin will re-open the question for you and you may then re-assign the points. All-in-all, we're a very friendly community. :)  Welcome aboard! Regards, Joe