How can 32-bit application find the location of 64-bit Program Files directory on Windows Vista 64-bit?

前端 未结 4 453
鱼传尺愫
鱼传尺愫 2021-01-12 02:31

I\'m struggling with a problem of how to determine the location of the 64-bit Program Files directory on 64-bit Windows Vista from a 32-bit application.

Calls to

4条回答
  •  隐瞒了意图╮
    2021-01-12 02:51

    You can also query the environment variable ProgramW6432. It obviously exists only in 64-bit Windows, but it should return the real 64-bit Program Files directory, and it seems to be defined for both 64-bit and 32-bit programs. At least it worked for me (C#, GetEnvironmentVariable)...

提交回复
热议问题