@echo off setlocal echo Killing electron / python uvicorn / ports 8014 5173 8015... taskkill /F /IM electron.exe >nul 2>&1 for /f "tokens=5" %%p in ('netstat -ano ^| findstr ":8014 .*LISTENING"') do taskkill /F /PID %%p >nul 2>&1 for /f "tokens=5" %%p in ('netstat -ano ^| findstr ":8015 .*LISTENING"') do taskkill /F /PID %%p >nul 2>&1 for /f "tokens=5" %%p in ('netstat -ano ^| findstr ":5173 .*LISTENING"') do taskkill /F /PID %%p >nul 2>&1 wmic process where "CommandLine like '%%uvicorn app.main%%'" call terminate >nul 2>&1 timeout /t 3 /nobreak >nul cd /d c:\Users\admin\Desktop\douyinWEB\desktop call npm run build:electron if errorlevel 1 exit /b 1 echo Starting electron:dev ... start "douyin-desktop" cmd /k "cd /d c:\Users\admin\Desktop\douyinWEB\desktop && npm run electron:dev" timeout /t 12 /nobreak >nul echo. echo === /api/ping === curl.exe -m 5 -s -w "\nhttp=%%{http_code} t=%%{time_total}\n" http://127.0.0.1:8014/api/ping echo === /api/health === curl.exe -m 5 -s -w "\nhttp=%%{http_code} t=%%{time_total}\n" http://127.0.0.1:8014/api/health echo. echo If ping returns ok, open the Electron window and click Shorts. pause endlocal