%ProgramData% and Roaming Profiles

All of my desktop products use the Windows %ProgramData% folder to store files such as configuration files, log files, database files and so on. Basically any file that needs to be written to is stored there. It’s simply not good practice to store files that need to be written to in the %ProgramFiles% folder because there’s no guarantee the Windows user will have write permissions on files stored there. Now, usually the %ProgramData% folder can be found here:

c:\Program Data\

I store the data for each program in a folder something like:

c:\Program Data\Program Name\

That’s all dandy but when an application is 32bit Windows can be configured (via the UAC) to use a “VirtualStore” for any files that are modified and Windows considers that those files should be protected. I am not entirely sure why, but the ProgramData folder can be thrown in this boat and it ends up getting virtualized. The upshot of this is that when I go and take a look at a config file for one of my programs (in the C:\ProgramData\Program Name\ folder) the file is either empty or contains only the initial set of data. Yet, the program still runs perfectly and is saving config options without issue. So where is Windows actually storing the files that the software is changing? It’s here:

C:\Users\UserName\AppData\Local\VirtualStore\ProgramData\Program Name\

Hopefully this blog entry stops me from tearing my hair out in the future when I am looking for this location again!