How to check location of 32bit Program FIles folder in windows .bat script

Posted by Arek on Stack Overflow See other posts from Stack Overflow or by Arek
Published on 2010-05-19T10:19:26Z Indexed on 2010/05/19 10:50 UTC
Read the original article Hit count: 336

Filed under:
|
|
|
|

I want to write .bat script which works under all flavours of Windows, no matter if 32 or 64 bit.

In this script I want to run some file.exe. That file is located in C:\Program Files\ under 32-bit systems or C:\Program FIles (x86)\ under x64 systems. I can write:

"%ProgramFiles(x86)%\file.exe" under 64bit systems or "%ProgramFiles%\file.exe" under 32bit systems but I want to make the script universal. Is there any way of determining that path universally?

© Stack Overflow or respective owner

Related posts about Windows

Related posts about .bat