There is a program that must save and load some settings: the position and size of the main program window, the identifier of the selected language, the 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 program settings and files:
- Program Files
- My documents
- User \ Application Data
- User \ Local Settings \ Application Data
- All Users \ Application data
Program FilesIt is not recommended to store settings in the folder of the program itself, the user may simply not have enough rights to write and read the program directory. Plus (or rather, minus) user settings will be shared, no one will be able to customize the program for themselves, or store only personal data in it.
My documentsXP :
Documents and Settings \ User \ My DocumentsVista :
Users \ User \ DocumentsIn my opinion not the right approach. The folder is not for nothing called
My Documents . Therefore, if the program does not generate any documents, but only has to store its settings, then there is no place for them. I do not know about you, but I am slightly annoyed by the folders inside the document folder. I arrange them there, by the way, I arrange them, stuff them into subdirectories, and then you, I go to the folder and see
Visual Studio 2008 .
')
User \ Application DataXP :
Documents and Settings \ User \ Application DataVista :
Users \ User \ AppData \ RoamingFiles from this folder are part of roaming profiles (
per-user ). Those. if you want your program data to be moved with your user profile, store it in this folder.
User \ Local Settings \ Application DataXP :
Documents and Settings \ User \ Local SettingsVista :
Users \ User \ AppData \ LocalIn this folder, you can store files that are not part of relocatable profiles (
per-user-per-machine ), as well as temporary and large-sized files that are either not required to be moved (temporary, cache, other garbage), or it will take considerable time (keep the file a couple of hundred megabytes in size in the roaming profile and the user will definitely say thank you).
All Users \ Application dataXP :
Documents and Settings \ All Users \ Application DataVista :
ProgramDataIn this folder, you can store files that are common to all computer users, such as a common database, a set of common documents, clipart, etc. This folder is not included in the
per-machine roaming profile. Regular users (not administrators) have access to this folder in read-only mode.