Vista and ProgramData

frast picture frast · Sep 25, 2008 · Viewed 10k times · Source

What is the right place to store program data files which are the same for every user but have to be writeable for the program? What would be the equivalent location on MS Windows XP? I have read that C:\ProgramData is not writeable after installation by normal users. Is that true? How can I retrieve that directory programmatically using the Platform SDK?

Answer

Franci Penov picture Franci Penov · Sep 25, 2008

SHGetFolderPath() with CSIDL of CSIDL_COMMON_APPDATA.

Read more at http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx

If you need the path in a batch file, you can also use the %ALLUSERSPROFILE% environment variable.