@echo off
REM Run GeViScopeConfigReader

echo =============================================
echo GeViScope Configuration Reader
echo =============================================
echo.

cd /d "%~dp0bin\Debug\net48"

if not exist "GeViScopeConfigReader.exe" (
    echo ERROR: GeViScopeConfigReader.exe not found
    echo.
    echo Please build the project first:
    echo   cd "%~dp0"
    echo   dotnet build
    echo.
    pause
    exit /b 1
)

echo Make sure GeViScope Server is running!
echo   If not started: "C:\Program Files (x86)\GeViScopeSDK\BIN\GSCServer.exe"
echo.
echo Starting configuration reader...
echo.
echo Default connection:
echo   Server: localhost
echo   Username: sysadmin
echo   Password: masterkey
echo   Output: geviScope_config.json
echo.

GeViScopeConfigReader.exe

echo.
if exist "geviScope_config.json" (
    echo =============================================
    echo Success! Configuration exported to:
    echo %cd%\geviScope_config.json
    echo =============================================
    echo.
    echo View the file:
    echo   notepad geviScope_config.json
    echo.
) else (
    echo =============================================
    echo Export failed - check error messages above
    echo =============================================
    echo.
)

pause
