Windows查看进程信息

in with 0 comment  访问: 2,451 次

1、根据端口查看进程PID

命令案例:

netstat -aon |findstr ":135"

实际案例:

C:\Users\administrator>netstat -aon |findstr ":135"
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1022
  TCP    [::]:135               [::]:0                 LISTENING       1022
  TCP    [::1]:135              [::1]:64830            ESTABLISHED     1022

查看进程所有端口:

netstat -ano | findstr /i "PID"

2、根据PID查看进程

命令案例:

tasklist | findstr 1022

实际案例:

C:\Users\administrator>tasklist |findstr 1022
svchost.exe                   1022 Services                   0     20,228 K

3、查看进程详细信息

wmic方式:

wmic process where "ProcessID=<PID>" get CommandLine,ProcessId, ParentProcessId
wmic process where "name like '%进程名称%'" get Caption,ProcessId,ExecutablePath,CommandLine

PowerShell方式:

Get-Process -Id <PID> | Select-Object ProcessName,Id,Path

4、杀掉进程

命令案例:

taskkill /f /t /pid 14344

image-20220915110533776.png

WeZan