Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What directories do the different Application SpecialFolders point to in WindowsXP and Windows Vista

Namely I have:

  • Environment.SpecialFolder.ApplicationData
  • Environment.SpecialFolder.CommonApplicationData
  • Environment.SpecialFolder.LocalApplicationData

I am unclear as to were these point to in Windows XP and/or Windows Vista.

What I found so far is that the ApplicationData points to the ApplicationData Folder for the current user in XP and the roaming application data folder in Vista.

I would also like to know if there are general guidelines on when to use which.

like image 633
Thorsten Lorenz Avatar asked Mar 23 '10 15:03

Thorsten Lorenz


1 Answers

There's no single answer to that. In fact, that's precisely why these "SpecialFolder"s are defined. You use those instead of a hardcoded path.

Environment.SpecialFolder.ApplicationData is the most common one. This folder holds per-user, non-temporary application-specific data, other than user documents. A common example would be a settings or configuration file.

Environment.SpecialFolder.CommonApplicationData is similar, but shared across users. You could use this to store document templates, for instance.

Environment.SpecialFolder.LocalApplicationData is a non-roaming alternative for ApplicationData. As such, you'd never store important data there. However, because it's non-roaming it is a good location for temporary files, caches, etcetera. It's typically on a local disk.

like image 139
MSalters Avatar answered Sep 22 '22 08:09

MSalters