Roy*_*mir 57 windows-7 powershell netstat cmd.exe
使用netstat -a -o -n
我可以获得端口和PID的列表
然后我需要去任务管理器并添加PID,看看它是谁。(相当令人沮丧)
我想知道是否有一个 CMD 命令可以完成这一切(使用find
, for
, powershell
)
这样我就可以得到进程名称
and*_*415 70
使用-b
参数:
-b Displays the executable involved in creating each connection or
listening port. In some cases well-known executables host
multiple independent components, and in these cases the
sequence of components involved in creating the connection
or listening port is displayed. In this case the executable
name is in [] at the bottom, on top is the component it called,
and so forth until TCP/IP was reached. Note that this option
can be time-consuming and will fail unless you have sufficient
permissions.
Run Code Online (Sandbox Code Playgroud)
注意netstat -b
除非从提升的命令提示符运行,否则该命令将失败。
过滤进程列表并找到您感兴趣的 PID:
tasklist | findstr /c:"PID"
Run Code Online (Sandbox Code Playgroud)
你可以Tcpvcon.exe
改用。不需要管理员权限。
Tcpvcon 的用法类似于内置的 Windows
netstat
实用程序。
Usage: tcpvcon [-a] [-c] [-n] [process name or PID]
-a Show all endpoints (default is to show established TCP connections).
-c Print output as CSV.
-n Don't resolve addresses.
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
229881 次 |
最近记录: |