I'd like to write a batch file, where some commands target items in the
Program Files folder, that is naturally cross-compatible from Windows XP up to Windows 7 x64 and Server 2008 R2. However, the folder name I'd need in the 64-bit systems is
Program Files (x86).
Is there a batch command that will allow me to detect the system architecture, and write an IF statement to use the appropriate folder? Alternately, is there a universally-applicable environment variable that will point me to the right folder? Or, would I have to set part of my script to look for the x86 folder and use it if present, only using the other folder if it's not?