7

I'm porting an application to Windows and I need to decide where to store user settings and session information on the filesystem. Under linux I put everything under ~/.myapp. I could do the same on Windows, but I'm wondering what the canonical approach is for this.

Things that will be stored in this directory:

  • user settings that need to persist across app lifetimes

  • user authentication information

  • logs

1 Answers1

12

The %userprofile% variable is the closest thing to that. It'll expands to your user directory (c:\users\foo). This is probably not the canonical place

However I believe for this sort of thing %appdata% (which expands to %userprofile%\appdata\roaming)- which essentially is used for the sort of thing that dotfolders are used for or the registry would be more appropriate. This is used even if you're not actually on a domain or roaming.

You can find a full list of environmental variables here

Journeyman Geek
  • 133,878