@echo off setlocal cd /d "%~dp0.." echo [1/3] Killing stale Electron / Vite / API on 8014 5173... 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 ":5173 .*LISTENING"') do taskkill /F /PID %%p >nul 2>&1 timeout /t 2 /nobreak >nul echo [2/3] Starting desktop (local PB + API + UI)... cd /d "%~dp0..\desktop" call npm run build:electron start "douyinWEB-desktop" cmd /k "npm run electron:dev" echo [3/3] Waiting for API health... timeout /t 8 /nobreak >nul curl -s -m 5 http://127.0.0.1:8014/api/health echo. echo Done. Use the Electron window; Shorts nav should switch pages immediately. endlocal