Where does the program store its settings?
There is a program that must save and load some settings: position and size of the main program window, identifier of the selected language, time of the last update check. I wondered - where should the program store its settings? I decided to collect information on this topic and share it with you.
Possible folders for storing settings and program files:
Program Files It is
not recommended to store the settings in the folder of the program itself; the user may simply not have enough permissions to write and read the program directory. Plus (or rather minus) user settings will be common, no one will be able to customize the program for themselves or store only personal data in it.
My Documents
XP : Documents and Settings \ User \ My Documents
Vista : Users \ User \ Documents
In my opinion, the wrong approach. The folder is not for nothing called My Documents. Therefore, if the program does not generate any documents, but only needs to store its settings, then they do not have a place there. I don’t know about you, but the folders inside the folder with documents slightly annoy me. I organize them there, by the way, push them into subdirectories and here on you, I go into the folder and see Visual Studio 2008 .
User \ Application Data
XP : Documents and Settings \ User \ Application Data
Vista : Users \ User \ AppData \ Roaming
Files from this folder are part of roaming profiles ( per-user ). Those. if you want the data of your program to be able to move along with the user profile, store them in this folder.
User \ Local Settings \ Application Data
XP : Documents and Settings \ User \ Local Settings
Vista : Users \ User \ AppData \ Local
In this folder you can store files that are not part of roaming profiles ( per-user-per-machine ), as well as temporary and large in size files whose transfer is either not required (temporary, cache, other working “garbage”), or will require significant time expenses (store a file of a couple hundred megabytes in the roaming profile and the user will definitely say “thank you”).
All Users \ Application data
XP : Documents and Settings \ All Users \ Application Data
Vista : ProgramData
In this folder you can store files that are shared by all computer users, for example, a common database, a set of shared documents, clipart, etc. This folder is not part of roaming profiles ( per-machine ). Ordinary users (not administrators) have read-only access to this folder.
Possible folders for storing settings and program files:
- Program files
- My documents
- User \ Application Data
- User \ Local Settings \ Application Data
- All Users \ Application data
Program Files It is
not recommended to store the settings in the folder of the program itself; the user may simply not have enough permissions to write and read the program directory. Plus (or rather minus) user settings will be common, no one will be able to customize the program for themselves or store only personal data in it.
My Documents
XP : Documents and Settings \ User \ My Documents
Vista : Users \ User \ Documents
In my opinion, the wrong approach. The folder is not for nothing called My Documents. Therefore, if the program does not generate any documents, but only needs to store its settings, then they do not have a place there. I don’t know about you, but the folders inside the folder with documents slightly annoy me. I organize them there, by the way, push them into subdirectories and here on you, I go into the folder and see Visual Studio 2008 .
User \ Application Data
XP : Documents and Settings \ User \ Application Data
Vista : Users \ User \ AppData \ Roaming
Files from this folder are part of roaming profiles ( per-user ). Those. if you want the data of your program to be able to move along with the user profile, store them in this folder.
User \ Local Settings \ Application Data
XP : Documents and Settings \ User \ Local Settings
Vista : Users \ User \ AppData \ Local
In this folder you can store files that are not part of roaming profiles ( per-user-per-machine ), as well as temporary and large in size files whose transfer is either not required (temporary, cache, other working “garbage”), or will require significant time expenses (store a file of a couple hundred megabytes in the roaming profile and the user will definitely say “thank you”).
All Users \ Application data
XP : Documents and Settings \ All Users \ Application Data
Vista : ProgramData
In this folder you can store files that are shared by all computer users, for example, a common database, a set of shared documents, clipart, etc. This folder is not part of roaming profiles ( per-machine ). Ordinary users (not administrators) have read-only access to this folder.