@echo off setlocal enabledelayedexpansion >nul 2>&1"%SYSTEMROOT%\system32\cacls.exe""%SYSTEMROOT%\system32\config\system" if'%errorlevel%' NEQ '0' ( goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echoSet UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" exit /B :gotAdmin if exist "%temp%\getadmin.vbs" ( del"%temp%\getadmin.vbs" ) pushd"%CD%" CD /D "%~dp0" set PORT=8888 set /a TIMEOUT=5 echo Checking for processes running on port %PORT%... for /f "tokens=5" %%a in ('netstat -ano ^| findstr :%PORT%') do ( set PID=%%a goto foundProcess ) echo No process found running on port %PORT%. goto endScript :foundProcess echo Found process with PID: !PID! set /p CHOICE=Would you like to kill this process? (Y/N): if /i "!CHOICE!"=="Y" ( taskkill /F /PID !PID! echoProcess on port %PORT% has been killed. ) else ( echoProcess on port %PORT% will not be killed. ) :endScript timeout /t %TIMEOUT% >nul echo Script will exit after %TIMEOUT% seconds... endlocal exit