I need to place some data from my process running under a logged in interactive user account into a persistent storage. The information in question is concerning user's desktop, screensaver, theme, and other desktop-related settings (in relation to my app.) I know that I can place this data as a binary key in the HKEY_CURRENT_USER registry key, but this data file can be somewhat large and I read somewhere that it's better not to put too much data into the System Registry.
So now I think I'll just save it in a binary file instead. The question is how do I find the appropriate location to save this file into? My main stipulation is that this file should "travel" (or roam
) along with the logged in user's profile.
Usually the best place is a sub-folder (named after your company or application so they use can identify where it came from) located under the
%APPDATA%
folder. You can get its location like this:There's more information on Pat Altimore's blog.