Locating the Standard Folders Where Data Belongs

[This is preliminary documentation and subject to change.]

For many standard folders, a qualified path can be obtained by calling SHGetSpecialFolderLocation with an appropriate CSIDL constant (CSIDL constants are defined in ShlObj.h, a Windows header file). The following standard folders are accessible in this way.

Standard Folder CSIDL Constant Name Hex
Alternate Startup (All Users; DBCS)
CSIDL_COMMON_ALTSTARTUP
0x1e
Alternate Startup (user's; DBCS)
CSIDL_ALTSTARTUP
0x1d
Application Data (user's profile)
CSIDL_APPDATA
0x1a
Control Panel virtual folder
CSIDL_CONTROLS
0x03
Cookies folder
CSIDL_COOKIES
0x21
Desktop (namespace root)
CSIDL_DESKTOP
0x00
Desktop folder ("All Users" profile)
CSIDL_COMMON_DESKTOPDIRECTORY
0x19
Desktop folder (user's profile)
CSIDL_DESKTOPDIRECTORY
0x10
Favorites folder (All Users profile)
CSIDL_COMMON_FAVORITES
0x1f
Favorites folder (user's profile)
CSIDL_FAVORITES
0x06
Fonts virtual folder
CSIDL_FONTS
0x14
History folder
CSIDL_HISTORY
0x22
Internet Cache folder
CSIDL_INTERNET_CACHE
0x20
Internet virtual folder
CSIDL_INTERNET
0x01
My Computer virtual folder
CSIDL_DRIVES
0x11
My Documents folder (user's)
CSIDL_PERSONAL
0x05
Network Neighborhood root
CSIDL_NETWORK
0x12
Network Neighborhood directory
CSIDL_NETHOOD
0x13
Personal folder (user's profile)
CSIDL_PERSONAL
0x05
Printers virtual folder
CSIDL_PRINTERS
0x04
PrintHood folder (user's profile)
CSIDL_PRINTHOOD
0x1b
Programs folder (under Start Menu in "All Users" profile)
CSIDL_COMMON_PROGRAMS
0X17
Programs folder (under Start Menu in user's profile)
CSIDL_PROGRAMS
0x02
Recent folder (user's profile)
CSIDL_RECENT
0x08
Recycle Bin folder
CSIDL_BITBUCKET
0x0a
SendTo folder (user's profile)
CSIDL_SENDTO
0x09
Start Menu ("All Users" profile)
CSIDL_COMMON_STARTMENU
0x16
Start Menu (user's profile)
CSIDL_STARTMENU
0x0b
Startup folder ("All Users" profile)
CSIDL_COMMON_STARTUP
0x18
Startup folder (user's profile)
CSIDL_STARTUP
0x07
Templates folder (user's profile)
CSIDL_TEMPLATES
0x15

Other standard folders can also be located using the following environment variables.

Standard Folder or Location Environment Variable
System drive %SystemDrive%
System root directory %SystemRoot%
Windows folder %windir%
Program Files folder %ProgramFiles%
User's profile folder %UserProfile%
Temporary folder (per user) %Temp%

Access to specific user profile folders such as My Documents or Application Data should be obtained through SHGetSpecialFolderLocation rather than by relying on a combination of an environment variable and the standard English folder name (such as %UserProfile%\Application Data\).