@echo off
title Stop XpenseAIQ
cd /d "%~dp0"
echo.
echo   ========================================
echo        Stopping XpenseAIQ...
echo   ========================================
echo.

if exist .xpenseaiq.pid (
  set /p PID=<.xpenseaiq.pid
  taskkill /pid %PID% /f >nul 2>&1
  if not errorlevel 1 (
    echo   [OK] XpenseAIQ stopped.
  ) else (
    echo   [INFO] XpenseAIQ was not running.
  )
  del .xpenseaiq.pid
) else (
  echo   [INFO] XpenseAIQ is not running.
)
echo.
timeout /t 3 >nul
