@echo off
setlocal
cd /d "%~dp0"

if not exist "%~dp0RicohAutoFSR.exe" (
  echo RicohAutoFSR.exe not found in:
  echo %~dp0
  pause
  exit /b 1
)

echo Browser priority: Chrome ^> Edge ^> Playwright Chromium
"%~dp0RicohAutoFSR.exe"
set "APP_EXIT=%errorlevel%"

echo.
if %APP_EXIT% neq 0 (
  echo Program exited with error.
  pause
) else (
  echo Program finished.
)
endlocal & exit /b %APP_EXIT%
