Is there an environment variable ProgramFilesx86 to locate C:\Program Files
(x86) on a 64-bit Windows? 

Although some of the MSDN documentation specifically mentions an environment
variable ProgramFilesX96 member in the Environment.SpecialFolder Enumeration
(http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.as
px ), it isn't shown by intellisense -
Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesx86)
and doesn't compile. 

Further, while I can use the Windows Run to expand %ProgramFiles(x86)% - 

"%ProgramFiles(x86)%\TextPad 5\TextPad.exe" -m -r  "C:\Users\(some
location)\MyApp.log"

will work as desired, for example - if I want to start a process in code it
doesn't expand the environment variable - 

MyProcess.StartInfo.Filename = "%ProgramFiles(x86)%\TextPad 5\TextPad.exe"

(fails) 

I am using 3.5 Framework, and need to remain with this. Maybe in 4.0 the
doco is correct and this works (have not tried) - or am I missing a few very
obvious things? 

  _____  

Ian Thomas
Victoria Park, Western Australia

Reply via email to