@echo off :: Admin check net session >nul 2>&1 if %errorLevel% neq 0 ( powershell -Command "Start-Process '%~f0' -Verb RunAs" exit /b ) echo ===================================== echo Port status check (Admin) echo ===================================== echo. for %%P in (16000) do ( netstat -qno | findstr LISTEN | findstr ":%%P " > nul if errorlevel 1 ( echo Port %%P : FREE ) else ( echo Port %%P : IN USE ) ) echo. echo ===================================== pause ``