我应该如何重新编码包含以下命令的 Windows XP cmd 批处理文件,以便在两个 .exe可能位于Program Files (x86)中的更高版本的 Windows 上也能正常工作?
start "GW" /WAIT "%PROGRAMFILES%\GoldWave\GoldWave.exe" [...arguments...]
start "BC" /WAIT "%PROGRAMFILES%\Beyond Compare 3\BCompare.exe" [...arguments...]
这失败了:
PATH=%PATH%;%PROGRAMFILES%;%PROGRAMFILES(X86)%
...
start "GW" /WAIT "GoldWave\GoldWave.exe" [...arguments...]
start "BC" /WAIT "Beyond Compare 3\BCompare.exe" [...arguments...]
这成功但很笨拙:
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...]