@echo off
if not defined PROCESSOR_ARCHITECTURE goto PROCESSOR_ARCHITECTURE_NOT_DEF

if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto X64
"%~dp0%PROCESSOR_ARCHITECTURE%\%~n0.exe" %*
goto :EOF

:X64
"%~dp0x64\%~n0.exe" %*
goto :EOF

:PROCESSOR_ARCHITECTURE_NOT_DEF
echo.
echo ## Environment variable "PROCESSOR_ARCHITECTURE" is not defined.
goto ERROR

:ERROR
verify # 2>nul
goto :EOF
