added options for count
This commit is contained in:
parent
6a9e572fe2
commit
38b2412fa9
12
tcpcon.bat
12
tcpcon.bat
@ -4,12 +4,18 @@
|
||||
cls
|
||||
echo Monitoring TCP Connections...
|
||||
echo.
|
||||
set /p option="Enter 'a' for all TCP connections or 'e' for established connections: "
|
||||
|
||||
set /p option="Enter 'a' for all TCP connections, 'e' for established connections, 'ac' for all connections count, or 'ec' for established connections count: "
|
||||
|
||||
if "%option%"=="a" (
|
||||
netstat -an | findstr /c:"TCP" /c:"Active Connections"
|
||||
netstat -an | findstr /c:"TCP"
|
||||
) else if "%option%"=="e" (
|
||||
netstat -an | findstr /c:"ESTABLISHED"
|
||||
)else (
|
||||
) else if "%option%"=="ac" (
|
||||
netstat -an | findstr /c:"TCP" /c:"Active Connections"
|
||||
) else if "%option%"=="ec" (
|
||||
netstat -an | findstr /c:"ESTABLISHED" | find /c /v ""
|
||||
) else (
|
||||
echo Invalid option. Please try again.
|
||||
)
|
||||
timeout /t 5 > nul
|
||||
|
Loading…
Reference in New Issue
Block a user