I want to make a batch or command script that can find the proper program to use in accordance with the local machines processor architecture for 32-bit and 64-bit programs.
One program I would like to try this with is WinRAR. I want to place the 64-bit version in a folder called "x64" and the 32-bit in a folder labeled "x86" with the script besides these folders.
I have noticed that some programs such as Cheat Engine, have a 32 and 64 bit version that also include an executable that can do this.
Currently my only lead is the %process_architecture%
variable. This was the script I made using @dbenham's original script:
echo %processor_architecture%%processor_architew6432% | findstr 64 >nul && set "prog=x64\WinRAR x64.exe" || set "prog=x86\WinRAR x86.exe"