Skip to content

Instantly share code, notes, and snippets.

@dahlia
Last active December 11, 2019 07:46
Embed
What would you like to do?
.NET Environment.GetFolderPath()

.NET Environment.GetFolderPath()

macOS

Environment.GetFolderPath() Path
Desktop "/Users/USER/Desktop"
Programs ""
MyDocuments "/Users/USER"
MyDocuments "/Users/USER"
Favorites "/Users/USER/Library/Favorites"
Startup ""
Recent ""
SendTo ""
StartMenu ""
MyMusic "/Users/USER/Music"
MyVideos ""
DesktopDirectory "/Users/USER/Desktop"
MyComputer ""
NetworkShortcuts ""
Fonts "/Users/USER/Library/Fonts"
Templates ""
CommonStartMenu ""
CommonPrograms ""
CommonStartup ""
CommonDesktopDirectory ""
ApplicationData "/Users/USER/.config"
PrinterShortcuts ""
LocalApplicationData "/Users/USER/.local/share"
InternetCache "/Users/USER/Library/Caches"
Cookies ""
History ""
CommonApplicationData "/usr/share"
Windows ""
System "/System"
ProgramFiles "/Applications"
MyPictures "/Users/USER/Pictures"
UserProfile "/Users/USER"
SystemX86 ""
ProgramFilesX86 ""
CommonProgramFiles ""
CommonProgramFilesX86 ""
CommonTemplates ""
CommonDocuments ""
CommonAdminTools ""
AdminTools ""
CommonMusic ""
CommonPictures ""
CommonVideos ""
Resources ""
LocalizedResources ""
CommonOemLinks ""
CDBurning ""

Windows

Environment.GetFolderPath() Path
Desktop @"C:\Users\USER\Desktop"
Programs @"C:\Users\USER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
Personal @"C:\Users\USER\Documents"
Personal @"C:\Users\USER\Documents"
Favorites @"C:\Users\USER\Favorites"
Startup @"C:\Users\USER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
Recent @"C:\Users\USER\AppData\Roaming\Microsoft\Windows\Recent"
SendTo @"C:\Users\USER\AppData\Roaming\Microsoft\Windows\SendTo"
StartMenu @"C:\Users\USER\AppData\Roaming\Microsoft\Windows\Start Menu"
MyMusic @"C:\Users\USER\Music"
DesktopDirectory @"C:\Users\USER\Desktop"
MyComputer @""
Templates @"C:\Users\USER\AppData\Roaming\Microsoft\Windows\Templates"
ApplicationData @"C:\Users\USER\AppData\Roaming"
LocalApplicationData @"C:\Users\USER\AppData\Local"
InternetCache @"C:\Users\USER\AppData\Local\Microsoft\Windows\Temporary Internet Files"
Cookies @"C:\Users\USER\AppData\Roaming\Microsoft\Windows\Cookies"
History @"C:\Users\USER\AppData\Local\Microsoft\Windows\History"
CommonApplicationData @"C:\ProgramData"
System @"C:\Windows\system32"
ProgramFiles @"C:\Program Files"
MyPictures @"C:\Users\USER\Pictures"
CommonProgramFiles @"C:\Program Files\Common Files"
"| ``Environment.GetFolderPath()`` | Path |"
"|---------------------------------|------|"
foreach ($t in [System.Enum]::GetValues([System.Environment+SpecialFolder]))
{
"| ``$t`` | ``@`"$([System.Environment]::GetFolderPath($t))`"`` |"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment