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

set "NODE_BIN=node"
where node >nul 2>nul
if errorlevel 1 (
  if exist "%ProgramFiles%\nodejs\node.exe" (
    set "NODE_BIN=%ProgramFiles%\nodejs\node.exe"
  ) else (
    echo Node.js not found. Please install Node.js first.
    pause
    exit /b 1
  )
)

"%NODE_BIN%" src\test-print.js
if errorlevel 1 (
  echo Test print failed.
  pause
  exit /b 1
)

echo Test print sent.
pause
exit /b 0
