hello,

you can read directly values in the registry
look at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
and read value "ProgramFilesDir" or "ProgramFilesDir (x86)"

take care to WOW64AlternateRegView option. Be sure to read the real key not this redirect in HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion
_________________________
Christophe