How should I recode a Windows XP cmd batch file containing the commands below to work also on later Windows where the two .exes may be in Program Files (x86)?
start "GW" /WAIT "%PROGRAMFILES%\GoldWave\GoldWave.exe" [...arguments...]
start "BC" /WAIT "%PROGRAMFILES%\Beyond Compare 3\BCompare.exe" [...arguments...]
This fails:
PATH=%PATH%;%PROGRAMFILES%;%PROGRAMFILES(X86)%
...
start "GW" /WAIT "GoldWave\GoldWave.exe" [...arguments...]
start "BC" /WAIT "Beyond Compare 3\BCompare.exe" [...arguments...]
This succeeds but is clumsy:
PATH=%PATH%;%PROGRAMFILES%\Goldwave;%PROGRAMFILES(X86)%\Goldwave;%PROGRAMFILES%\Beyond Compare 3;%PROGRAMFILES(X86)%\Beyond Compare 3%
...
start "GW" /WAIT "GoldWave.exe" [...arguments...]
start "BC" /WAIT "BCompare.exe" [...arguments...]