Solved

How to manage a single config file for multiple users?

Posted on 2014-02-17
5
292 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 52

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 52

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope this helps those who have been battling the SanDisk / U3 problem for a while. For anyone that is running Windows 7 64bit and is receiving and searching the internet for the “Windows Error: Windows has allocated a drive letter to the U3 dri…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

947 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

21 Experts available now in Live!

Get 1:1 Help Now