java获取进程端口_Windows根据进程号查找到执行的程序和程序服务端口

命令wmic process相关

列出进程java.exe的详细信息:

wmic process where name="java.exe" get /format:value

列出进程java.exe的进程路径:

wmic process where name="java.exe" get executablepath

列出进程java.exe的进程、进程路径、命令行、进程ID、父进程ID、线程数,内存使用:

wmic process where name="java.exe" get name,executablepath,commandline,processid,parentprocessid,threadcount,workingsetsize/value

结束所有的java.exe进程:

wmic process where name="java.exe" call terminate

根据进程java.exe找到进程号:

wmic process where name="java.exe" get executablepath,name,ProcessId

根据进程号结束进程:

wmic process where processid=12944 call terminate

根据进程查找到进程的信息

tasklist | findstr [进程]

eg:>tasklist | findstr java

java.exe                     29184 Console                    1     67,564 K

根据进程号查找到执行的程序

wmic process where name="[进程名]" get executablepath,name,ProcessId

eg:>wmic process where name="java.exe" get executablepath,nam

e,ProcessId

ExecutablePath                         Name      ProcessId

D:\Apps\Java\jdk1.8.0_65\bin\java.exe  java.exe  29184

根据进程号查找到服务的端口

netstat -ano | findstr [进程号]

eg:>netstat -ano | findstr 29184

TCP    127.0.0.1:8080         0.0.0.0:0              LISTENING       29184

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值