Skip to content

Print all folders of enum Environment.SpecialFolder

1 June 2010
foreach( Environment.SpecialFolder folder in Enum.GetValues(typeof(Environment.SpecialFolder)))
{
 Console.WriteLine(Enum.GetName(typeof (Environment.SpecialFolder), folder) + ": " + Environment.GetFolderPath(folder));
}

Possible output:

Desktop: C:\Users\Alex\Desktop
Programs: C:\Users\Alex\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
Personal: C:\Users\Alex\Documents
Personal: C:\Users\Alex\Documents
Favorites: C:\Users\Alex\Favorites
Startup: C:\Users\Alex\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Recent: C:\Users\Alex\AppData\Roaming\Microsoft\Windows\Recent
SendTo: C:\Users\Alex\AppData\Roaming\Microsoft\Windows\SendTo
StartMenu: C:\Users\Alex\AppData\Roaming\Microsoft\Windows\Start Menu
MyMusic: C:\Users\Alex\Music
DesktopDirectory: C:\Users\Alex\Desktop
MyComputer:
Templates: C:\Users\Alex\AppData\Roaming\Microsoft\Windows\Templates
ApplicationData: C:\Users\Alex\AppData\Roaming
LocalApplicationData: C:\Users\Alex\AppData\Local
InternetCache: C:\Users\Alex\AppData\Local\Microsoft\Windows\Temporary Internet Files
Cookies: C:\Users\Alex\AppData\Roaming\Microsoft\Windows\Cookies
History: C:\Users\Alex\AppData\Local\Microsoft\Windows\History
CommonApplicationData: C:\ProgramData
System: C:\Windows\system32
ProgramFiles: C:\Program Files
MyPictures: C:\Users\Alex\Pictures
CommonProgramFiles: C:\Program Files\Common Files
Advertisements

From → C#, Coding

Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: