The best directory to store application data with read / write permissions for all users?

Prior to Windows Vista, I saved application data in the directory where the program was installed. The most common place was "C: \ Program Files \ MyApplication". As you know, under Vista, and then a regular user does not have write permissions in the "Program Files" folder. So my first idea was to save the application data in the "All Users \ Application Data" folder. But it looks like there are write restrictions in this folder!

So, to summarize, my requirements are:

  • The folder must exist under Windows XP and above.
  • All users of the system must have read / write \ create rights to this folder and its subfolders and files.
  • I want to have only one copy of files / files for all users.
+6
language-agnostic windows file-io
source share
3 answers

Using environment variables is often useful, so you keep things more universal.

Vista has changed some things using NTFS junction points. See http://www.svrops.com/svrops/articles/jpoints.htm

In any case, using% appdata% should automatically put the files in the right place on xp / vista / 7

+2
source share

There is no such location. Even in Windows XP (and probably in 2000), such a location never existed; we just think this happened because we all worked with administrative privileges. Until Vista makes us work as a limited user, we understand our wrong assumptions. You will need to explicitly set permissions in your directory.

+1
source share

I would create a subfolder such as "All Users \ Application Data \ YourAppName \ Shared" so that it is clear that only this folder will contain files that are writable by all users by setting privileges in the installer.

0
source share

All Articles