-1

I need to display the 'program files' and 'Desktop' path on a spanish PC.

I am trying

Environment.SpecialFolder.Desktop;

Which is returning the text 'Desktop'. How do i get spanish text 'Escritorio' for desktop?

Gaddigesh
  • 1,953
  • 8
  • 30
  • 41

1 Answers1

2

The whole point of this variable is not having to worry about the exact name of the folder on the given computer. My Windows is in Spanish; if I write:

System.Diagnostics.Process.Start("explorer.exe",  Environment.GetFolderPath(Environment.SpecialFolder.Desktop));

My "escritorio" (...\Escritorio) is opened. If I write:

string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

I get ...\\Desktop, but does not really matter (with my Windows version, I can access my desktop by typing either "Desktop" or "Escritorio"). If you use the first line (Environment.GetFolderPath(Environment.SpecialFolder.Desktop)) on any computer you will certainly access the given desktop, independently upon its language.

varocarbas
  • 12,354
  • 4
  • 26
  • 37