Anne Quinn
Anne Quinn

Reputation: 12992

Where to save a program's config and save files on Windows?

What directory is the typical place to save files generated by a program, like a game or tool, when the file itself isn't necessarily useful on it's own? (i.e it's not a "document" like a text file or image that you'd want easy access to, instead it's just a config or save file you'd want to tuck someplace out of the way)

Does this change depending on if a program is "installed", as opposed to an executable free-floating in a folder? (For instance, is it standard practice to just save in the same folder in the latter case?)

If it's someplace that varies, is there a utility function I have to call to get a string of the path?

Upvotes: 0

Views: 863

Answers (1)

Michael Chourdakis
Michael Chourdakis

Reputation: 11148

Check the Known Folder IDs for a tip. Most likely, you want FOLDERID_LocalAppData. Use SHGetKnownFolderPath() to retrieve the folder location.

Usually, I give the users the ability for "install" or "portable", in the latter case the app files goes into a folder under the portable installation folder.

Upvotes: 4

Related Questions