I need to get the 64 bit "Program Files" folder path (the one that defaults to C:\Program Files, not the one that default to C:\Program Files (x86)) from a 32 bit program and for this I planned to use SHGetKnownFolderPath
.
Unfortunately it seems impossible to get that path from a 32 bit program running on a 64 bit Windows, at least this is what I conclude from the remarks section of the documentation.
Is there another method to do this?
I'm seriously thinking of stripping the " (x86)"
from the path I'm getting with SHGetKnownFolderPath
, or use some other ugly hack.