@echo off
chcp 65001 >nul
title JV-Link integrity check
cd /d C:\Users\oshim\jrvltsql

if not exist "venv32\Scripts\python.exe" (
  echo [NG] venv32\Scripts\python.exe not found
  pause
  exit /b 1
)

if not exist "diag_jvlink_integrity.py" (
  echo [NG] diag_jvlink_integrity.py not found in this folder
  echo Run scp block from instructions first
  pause
  exit /b 1
)

echo [INFO] FROM_TO is set inside diag_jvlink_integrity.py
echo [INFO] Output: diag_result.txt
echo.

venv32\Scripts\python.exe diag_jvlink_integrity.py

echo.
if exist diag_result.txt (
  echo ===== diag_result.txt =====
  type diag_result.txt
) else (
  echo [NG] diag_result.txt was not created
)
echo.
pause
exit /b %ERRORLEVEL%
