Jump to content

picking program files in 64 bit


Recommended Posts

My exe should run in both 32 and 64 OS, so I am compiling it as 32 bit exe.

But in 64 bit, it is picking C:\Program files (x86) for @ProgramFilesDir.

Can anyone suggest how to use C:\Program files\ in both 32 and 64 bit OS.

Link to comment
Share on other sites

There are multiple ways for this. Here is one :

Func _GetNativeProgramFilesDir()
    Local $sNativeProgramFilesDir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramW6432Dir")
    Return ( @error ? @ProgramFilesDir : $sNativeProgramFilesDir)

can also be done with EnvGet or else...

Edited by jguinch
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...