10 lines
484 B
Batchfile
10 lines
484 B
Batchfile
@echo off
|
|
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 }"
|
|
|
|
timeout /t 2
|