Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Thanks in advance,

I have an application which has an ini file , Windows 8 is creating ini file for each user in its
directory ("c:\users\guest\appdata\local\virtualstore\program files\My Application\") automatically and if i save settings from application then it saves here instead of
application installed directory which is ("c:\Program files\My Application").

Any help/solution will be highly appreciated.
Posted
Updated 1-Apr-13 20:34pm
v2
Comments
Kenneth Haugland 2-Apr-13 2:30am    
Well, an dINI file is just a text file, so each user could be identeried with a user id or a name, with the settings below. Depending on how large the settings are, you shoul dperhaps consider a SQLite database instead or something like that.
εїзεїзεїз 2-Apr-13 2:36am    
Thanks but It works fine on other OS , can i stop it in windows 8 is there any option in windows that it wont create multiple inis

1 solution

You should not be trying to store any information under ProgramFiles anyway: security policies make it harder and harder to do as writing to these folders is seen as possible virus activity.
There are many "safe" places you can store data (and ini files are data) - have a look here: Where should I store my data?[^]
 
Share this answer
 
Comments
εїзεїзεїз 2-Apr-13 3:07am    
thanks OriginalGriff nice article , actually its a legacy vb application.if i will change the ini file extension that might work , but then i have to change the file path in several other .dot net applications and recompile them etc, i thought there might be a way to do this but looks impossible.
OriginalGriff 2-Apr-13 3:14am    
You're welcome - the problem is that from Vista onwards, it has been getting (understandably) harder and harder to write anything in application folders - it may be worth "biting the bullet" and moving them all to a new location now, before a new OS (or OS update even) stops them working completely. And you *know* you will get the blame, not Microsoft! :laugh:
εїзεїзεїз 2-Apr-13 3:30am    
:D,yup agrees with you. going to change

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900