improve stop script with better error handling
This commit is contained in:
@@ -3,7 +3,6 @@ chcp 65001 >nul
|
||||
setlocal
|
||||
cd /d %~dp0
|
||||
|
||||
REM Stop processes using PowerShell
|
||||
powershell -ExecutionPolicy Bypass -Command "& { Write-Host 'Stopping processes on 8923 and 6173...' -ForegroundColor Cyan; $ports = @(8923, 6173); foreach ($port in $ports) { $p = Get-NetTCPConnection -LocalPort $port -ErrorAction SilentlyContinue; if ($p) { Stop-Process -Id $p.OwningProcess -Force; Write-Host \"Stopped port $port\" } }; Write-Host 'Done.' -ForegroundColor Green }"
|
||||
powershell -ExecutionPolicy Bypass -File stop.ps1
|
||||
|
||||
timeout /t 2
|
||||
pause
|
||||
|
||||
Reference in New Issue
Block a user