Files
PTC/windows/stop_ptc_share.bat

25 lines
864 B
Batchfile

@echo off
setlocal EnableExtensions
net session >nul 2>&1
if not "%errorlevel%"=="0" (
echo 관리자 권한으로 다시 실행합니다...
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
exit /b
)
echo 포트포워딩 제거 중...
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=8000 >nul 2>&1
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=4000 >nul 2>&1
echo 방화벽 규칙 제거 중...
netsh advfirewall firewall delete rule name="PTC 8000" >nul 2>&1
netsh advfirewall firewall delete rule name="PTC 4000" >nul 2>&1
echo WSL 서버 종료 중...
wsl.exe bash -lc "pkill -f 'python3 -m http.server 8000' >/dev/null 2>&1 || true; pkill -f '/home/hyein/project/server/ptc_api_server.py' >/dev/null 2>&1 || true"
echo 종료 완료
pause