Retrieving Common Windows Paths

Someone asked me recently how to find the path to where Windows is installed. Well it’s pretty easy using the code below:

 var path = Environment.GetFolderPath(Environment.SpecialFolder.Windows);

Turns out there is a wealth of path information using the Environment.Special folder enumuration. Here is the output from my XP development machine:

Desktop - C:\Documents and Settings\dotNetDave\Desktop
Programs - C:\Documents and Settings\dotNetDave\Start Menu\Programs
Personal - C:\Documents and Settings\dotNetDave\My Documents
Personal - C:\Documents and Settings\dotNetDave\My Documents
Favorites - C:\Documents and Settings\dotNetDave\Favorites
Startup - C:\Documents and Settings\dotNetDave\Start Menu\Programs\Startup
Recent - C:\Documents and Settings\dotNetDave\Recent
SendTo - C:\Documents and Settings\dotNetDave\SendTo
StartMenu - C:\Documents and Settings\dotNetDave\Start Menu
MyMusic - C:\Documents and Settings\dotNetDave\My Documents\My Music
MyVideos - C:\Documents and Settings\dotNetDave\My Documents\My Videos
DesktopDirectory - C:\Documents and Settings\dotNetDave\Desktop
MyComputer -
NetworkShortcuts - C:\Documents and Settings\dotNetDave\NetHood
Fonts - C:\WINDOWS\Fonts
Templates - C:\Documents and Settings\dotNetDave\Templates
CommonStartMenu - C:\Documents and Settings\All Users\Start Menu
CommonPrograms - C:\Documents and Settings\All Users\Start Menu\Programs
CommonStartup - C:\Documents and Settings\All Users\Start Menu\Programs\Startup
CommonDesktopDirectory - C:\Documents and Settings\All Users\Desktop
ApplicationData - C:\Documents and Settings\dotNetDave\Application Data
PrinterShortcuts - C:\Documents and Settings\dotNetDave\PrintHood
LocalApplicationData - C:\Documents and Settings\dotNetDave\Local Settings\Application Data
InternetCache - C:\Documents and Settings\dotNetDave\Local Settings\Temporary Internet Files
Cookies - C:\Documents and Settings\dotNetDave\Cookies
History - C:\Documents and Settings\dotNetDave\Local Settings\History
CommonApplicationData - C:\Documents and Settings\All Users\Application Data
Windows - C:\WINDOWS
System - C:\WINDOWS\system32
ProgramFiles - C:\Program Files
MyPictures - C:\Documents and Settings\dotNetDave\My Documents\My Pictures
UserProfile - C:\Documents and Settings\dotNetDave
SystemX86 - C:\WINDOWS\system32
ProgramFilesX86 -
CommonProgramFiles - C:\Program Files\Common Files
CommonProgramFilesX86 -
CommonTemplates - C:\Documents and Settings\All Users\Templates
CommonDocuments - C:\Documents and Settings\All Users\Documents
CommonAdminTools - C:\Documents and Settings\All Users\Start Menu\Programs\Administrative Tools
AdminTools - C:\Documents and Settings\dotNetDave\Start Menu\Programs\Administrative Tools
CommonMusic - C:\Documents and Settings\All Users\Documents\My Music
CommonPictures - C:\Documents and Settings\All Users\Documents\My Pictures
CommonVideos - C:\Documents and Settings\All Users\Documents\My Videos
Resources - C:\WINDOWS\resources
LocalizedResources -
CommonOemLinks -
CDBurning - C:\Documents and Settings\dotNetDave\Local Settings\Application Data\Microsoft\CD Burning

Tip by: David McCarter

Advertisements

One thought on “Retrieving Common Windows Paths

  1. Hey thanks for this great post! I already knew how to retrieve various special folder paths but your listing of all the enumerations with sample paths really helps to visualize what it provides.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s