Problem is that in my case, a batch file run from 32 bit application have %ProgramFiles% expanding to "C:\Program Files (x86)".
2 Answers
You can get it from environment variable %ProgramW6432%. This variable exists on 64-bit Windows versions and always points to 64-bit instance of Program Files.
Read this SO for your answer:
It uses environment variables to identify x86 and 64-Bit Program Files folders
2