Environment::SpecialFolder Enumeration
Specifies enumerated constants used to retrieve directory paths to system special folders.
Assembly: mscorlib (in mscorlib.dll)
| Member name | Description | |
|---|---|---|
![]() | ApplicationData | The directory that serves as a common repository for application-specific data for the current roaming user. A roaming user works on more than one computer on a network. A roaming user's profile is kept on a server on the network and is loaded onto a system when the user logs on. |
| CommonApplicationData | The directory that serves as a common repository for application-specific data that is used by all users. | |
| LocalApplicationData | The directory that serves as a common repository for application-specific data that is used by the current, non-roaming user. | |
| Cookies | The directory that serves as a common repository for Internet cookies. | |
| Desktop | The logical Desktop rather than the physical file system location. | |
![]() | Favorites | The directory that serves as a common repository for the user's favorite items. |
| History | The directory that serves as a common repository for Internet history items. | |
| InternetCache | The directory that serves as a common repository for temporary Internet files. | |
![]() | Programs | The directory that contains the user's program groups. |
| MyComputer | The My Computer folder. NoteThe MyComputer constant always yields the empty string ("") because no path is defined for the My Computer folder. | |
| MyMusic | The My Music folder. | |
| MyPictures | The My Pictures folder. | |
| Recent | The directory that contains the user's most recently used documents. | |
| SendTo | The directory that contains the Send To menu items. | |
![]() | StartMenu | The directory that contains the Start menu items. |
![]() | Startup | The directory that corresponds to the user's Startup program group. The system starts these programs whenever a user logs on or starts Windows NT or later, or starts Windows 98. |
| System | The System directory. | |
| Templates | The directory that serves as a common repository for document templates. | |
| DesktopDirectory | The directory used to physically store file objects on the desktop. Do not confuse this directory with the desktop folder itself, which is a virtual folder. | |
![]() | Personal | The directory that serves as a common repository for documents. This member is equivalent to MyDocuments. |
| MyDocuments | The My Documents folder. This member is equivalent to Personal. | |
| ProgramFiles | The program files directory. | |
| CommonProgramFiles | The directory for components that are shared across applications. | |
| AdminTools | The file system directory that is used to store administrative tools for an individual user. The Microsoft Management Console (MMC) will save customized consoles to this directory, and it will roam with the user. | |
| CDBurning | The file system directory that acts as a staging area for files waiting to be written to a CD. | |
| CommonAdminTools | The file system directory that contains administrative tools for all users of the computer. | |
| CommonDocuments | The file system directory that contains documents that are common to all users. This special folder is valid for Windows NT systems, Windows 95, and Windows 98 systems with Shfolder.dll installed. | |
| CommonMusic | The file system directory that serves as a repository for music files common to all users. | |
| CommonOemLinks | This value is recognized in Windows Vista for backward compatibility, but the special folder itself is no longer used. | |
| CommonPictures | The file system directory that serves as a repository for image files common to all users. | |
| CommonStartMenu | The file system directory that contains the programs and folders that appear on the Start menu for all users. This special folder is valid only for Windows NT systems. | |
| CommonPrograms | A folder for components that are shared across applications. This special folder is valid only for Windows NT, Windows 2000, and Windows XP systems. | |
| CommonStartup | The file system directory that contains the programs that appear in the Startup folder for all users. This special folder is valid only for Windows NT systems. | |
| CommonDesktopDirectory | The file system directory that contains files and folders that appear on the desktop for all users. This special folder is valid only for Windows NT systems. | |
| CommonTemplates | The file system directory that contains the templates that are available to all users. This special folder is valid only for Windows NT systems. | |
| CommonVideos | The file system directory that serves as a repository for video files common to all users. | |
| Fonts | A virtual folder that contains fonts. | |
| MyVideos | The file system directory that serves as a repository for videos that belong to a user. | |
| NetworkShortcuts | A file system directory that contains the link objects that may exist in the My Network Places virtual folder. | |
| PrinterShortcuts | The file system directory that contains the link objects that can exist in the Printers virtual folder. | |
| UserProfile | The user's profile folder. Applications should not create files or folders at this level; they should put their data under the locations referred to by ApplicationData. | |
| CommonProgramFilesX86 | The Program Files folder. | |
| ProgramFilesX86 | The Program Files folder. | |
| Resources | The file system directory that contains resource data. | |
| LocalizedResources | The file system directory that contains localized resource data. | |
| SystemX86 | The Windows System folder. | |
| Windows | The Windows directory or SYSROOT. This corresponds to the %windir% or %SYSTEMROOT% environment variables. |
The system special folders are folders such as Program Files, Programs, System, or Startup, which contain common information. Special folders are set by default by the system, or explicitly by the user, when installing a version of Windows.
The GetFolderPath method returns the locations associated with this enumeration. The locations of these folders can have different values on different operating systems, the user can change some of the locations, and the locations are localized.
For more information about special folders, see the CSIDL values topic.
The following example shows how to use Environment::SpecialFolder with the GetFolderPath method to get the System directory.
// Sample for the Environment::GetFolderPath method using namespace System; int main() { Console::WriteLine(); Console::WriteLine( "GetFolderPath: {0}", Environment::GetFolderPath( Environment::SpecialFolder::System ) ); } /* This example produces the following results: GetFolderPath: C:\WINNT\System32 */
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Note