-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstop-full.bat
More file actions
33 lines (28 loc) · 800 Bytes
/
stop-full.bat
File metadata and controls
33 lines (28 loc) · 800 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
@echo off
:: ========== Anti-Crash Guard Shell ==========
if /i not "%~1"=="--guarded" (
start "Know Canvas Stop" cmd /k ""%~f0" --guarded"
exit /b 0
)
:: ========== End Guard ==========
setlocal enabledelayedexpansion
title Know Canvas - Stop All Services
echo.
echo ========================================
echo Stopping all Know Canvas services
echo ========================================
echo.
for %%p in (1234 18080 17081 5180 8765) do (
set "found=0"
for /f "tokens=5" %%a in ('netstat -ano 2^>nul ^| findstr ":%%p " ^| findstr "LISTENING"') do (
echo Stopping PID %%a on port %%p
taskkill /F /PID %%a >nul 2>&1
set "found=1"
)
if "!found!"=="0" echo Port %%p was free
)
echo.
echo All services stopped.
echo.
pause
endlocal