pozo-common-webapp/STOP-SERVER.bat

69 lines
1.8 KiB
Batchfile
Raw Normal View History

2026-01-27 11:54:15 +05:30
@echo off
setlocal enabledelayedexpansion
REM ======================================
REM POZO - Stop Local Development Server
REM ======================================
echo.
echo ========================================
echo Stopping POZO Server...
echo ========================================
echo.
REM First, try to kill processes using port 3000
echo Checking for processes on port 3000...
for /f "tokens=5" %%a in ('netstat -ano 2^>nul ^| findstr :3000 ^| findstr LISTENING') do (
echo Found process on port 3000: PID %%a
taskkill /F /PID %%a >nul 2>&1
if errorlevel 1 (
echo [ERROR] Cannot kill process %%a - Access denied
echo You may need to run this script as Administrator
) else (
echo [SUCCESS] Killed process %%a
)
)
REM Wait a moment
timeout /t 1 /nobreak >nul
REM Kill all node processes
echo.
echo Stopping all Node.js processes...
taskkill /F /IM node.exe >nul 2>&1
if errorlevel 1 (
echo [WARNING] Some processes could not be killed
echo You may need Administrator privileges
) else (
echo [SUCCESS] All Node.js processes stopped
)
REM Wait for processes to terminate
timeout /t 2 /nobreak >nul
REM Verify
echo.
echo Verifying...
tasklist /FI "IMAGENAME eq node.exe" 2>nul | find /I "node.exe" >nul
if errorlevel 1 (
echo [SUCCESS] All Node.js processes stopped successfully!
) else (
echo.
echo [WARNING] Some Node.js processes are still running!
echo.
echo To fix this:
echo 1. Right-click STOP-SERVER.bat
echo 2. Select "Run as administrator"
echo.
echo Or manually run in Command Prompt (as Admin):
echo taskkill /F /IM node.exe
echo.
tasklist /FI "IMAGENAME eq node.exe"
)
echo.
echo ========================================
echo Done!
echo ========================================
echo.
pause