Environment.SpecialFolder.ProgramFiles value for a 32-bit application on Windows 7?

Sameer Rastogi picture Sameer Rastogi · Aug 3, 2010 · Viewed 11.1k times · Source

What would a 32-bit application running on Windows 7 return for the below?

Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)

C:\Program Files (x86) or C:\Program Files?

Answer

Mario picture Mario · Aug 3, 2010

On 32 bit Windows 7 you should get "C:\Program Files", on 64 bit "C:\Program Files (x86)".