Search code examples
.netenvironment-variablesnon-english

Environment.SpecialFolder on foreign windows


Can anyone tell me if Environment.SpecialFolders works correctly on non-english versions of windows. for example. where the SpecialFolder.CommonProgramFiles is not "c:\program files\common files"?


Solution

  • Yes - that's the way to go. On a German Windows, the Environment.SpecialFolder.ProgramFiles setting would return C:\Programme, and the Environment.SpecialFolder.CommonProgramFiles would return C:\Programme\Gemeinsame Dateien (or something similar - I always use US-English Windows myself).

    Don't hardcode - use the Environment.SpecialFolders!

    Marc