How do I get 64 bit %ProgramFiles% in batch file that is run from 32 bit application?

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.

0

Read this SO for your answer:

It uses environment variables to identify x86 and 64-Bit Program Files folders

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like