Solved

How to manage a single config file for multiple users?

Posted on 2014-02-17
5
289 Views
Last Modified: 2014-02-17
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
0
Comment
Question by:MNuttall
  • 2
  • 2
5 Comments
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 39865194
You can't have a config file that is editable by everyone and keep everyone happy.  Instead save / load the config file from their own %appdata%\appname folder.
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
ID: 39865622
> 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
0
 

Author Closing Comment

by:MNuttall
ID: 39865806
Ok, I'll adopt a local config approach.
Many thanks for the quick response.
0
 

Author Comment

by:MNuttall
ID: 39865813
Joe, thanks for your comment. I would have shared the points but I'm new to this!
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
ID: 39865854
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
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

After playing around with my ASUS 1215n (http://www.asus.de/product.aspx?P_ID=HrglRhH8D60Rmlv3) Netbook, I finally managed to get smooth HD 1080p (http://en.wikipedia.org/wiki/1080p) playback of videos on it. Second Generation Intel Atom (http://en.…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now