@echo off cd /d "%~dp0" python -c "import serial" >nul 2>nul if errorlevel 1 ( echo Installing pyserial... python -m pip install -r requirements.txt if errorlevel 1 ( echo Failed to install pyserial. pause exit /b 1 ) ) python modbus_timing_tester.py if errorlevel 1 pause