@echo off title SPipe Stopper echo ======================================================== echo SPipe Process Stopper echo ======================================================== echo. set KILLED_COUNT=0 :: 1. Check and terminate Port 8000 (API) echo [1/2] Checking Port 8000 (SPipe API)... set PID_8000= for /f "tokens=5" %%a in ('netstat -ano ^| findstr /R /C:":8000 .*LISTENING"') do ( set PID_8000=%%a ) if "%PID_8000%"=="" ( echo - Port 8000 is empty. ) else ( echo - Port 8000 occupied by PID: %PID_8000%. Terminating... taskkill /F /PID %PID_8000% /T >nul 2>&1 echo - PID %PID_8000% terminated successfully. set /a KILLED_COUNT+=1 ) echo. :: 2. Check and terminate Port 5173 (Web) echo [2/2] Checking Port 5173 (SPipe Web)... set PID_5173= for /f "tokens=5" %%a in ('netstat -ano ^| findstr /R /C:":5173 .*LISTENING"') do ( set PID_5173=%%a ) if "%PID_5173%"=="" ( echo - Port 5173 is empty. ) else ( echo - Port 5173 occupied by PID: %PID_5173%. Terminating... taskkill /F /PID %PID_5173% /T >nul 2>&1 echo - PID %PID_5173% terminated successfully. set /a KILLED_COUNT+=1 ) echo. echo ======================================================== if %KILLED_COUNT% gtr 0 ( echo [RESULT] SPipe servers have been stopped. ) else ( echo [RESULT] No active SPipe servers were running. ) echo * Terminated only designated ports [8000, 5173]. echo ======================================================== echo. pause