-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop.bat
More file actions
34 lines (28 loc) · 928 Bytes
/
Copy pathstop.bat
File metadata and controls
34 lines (28 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off
setlocal
echo ===================================================
echo Enterprise ERP (EIP) - Safe Stop Script
echo ===================================================
cd /d "%~dp0"
echo [1/3] Closing NestJS and Web processes...
FOR /F "tokens=5" %%T IN ('netstat -a -n -o ^| findstr "0.0.0.0:8000" ') DO (
taskkill /f /pid %%T > nul 2>&1
)
FOR /F "tokens=5" %%T IN ('netstat -a -n -o ^| findstr "0.0.0.0:3000" ') DO (
taskkill /f /pid %%T > nul 2>&1
)
echo [2/3] Suspending Docker containers...
docker compose stop
NET SESSION >nul 2>&1
if %errorlevel% neq 0 (
echo [3/3] (Skipped) No Admin rights, skipping port reset.
) else (
echo [3/3] Cleaning up Windows NAT locks...
net stop winnat >nul 2>&1
net start winnat >nul 2>&1
)
echo.
echo ===================================================
echo System successfully stopped!
echo ===================================================
pause