CODE: [Copy to clipboard]
@echo off
::view connection by:everest@cn-dos.net
::!executablepath-expand-LO!set adv= wmicprocess where handle="%dtp%" get executablepath|find /v /i "executablepath"
:top
ECHO Simple Netstat 网络连接查看器 timeon:%time:~0,-3%
ECHO --------------------------------------------------------------------------------
ECHO 本机地址/端口 远程地址/端口 连接状态 进程 进程名称
for /f "skip=4 tokens=*" %%i in ('netstat -abn') do (
set nh=%%i x
call set nha=%%nh:]=%%
echo %%i|findstr /b "[">nul&&call echo %%nhb%% %%nha:~1,12%%||call set nhb=%%nh:~0,3%%:%%nh:~7,21%%-%%nh:~30,21%% %%nh:~53,11%% %%nh:~69,5%%&&call set adv=%%nh:~69,5%%
)
ECHO.&ECHO steering command: (r)refresh (c)close (cls)clear screen&ECHO.
:input
set /p cc="%CD%\netuse>"
if /i not "%cc%" == "cls" (if /i not "%cc%" == "r" (if /i not "%cc%" == "c" (goto input) else (exit/b)) else (echo/&echo.&echo\&goto top)) else (cls&goto input)
不满足的是没有一个简单快捷的方法获取进程完整路径