命令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