使用netstat -aon|findstr <port>即可可以查询到占用端口程序的PID

使用tasklist|findstr <pid>即可看到占用程序的相关信息

PS C:\Users\chancel> netstat -aon|findstr "3389"
  TCP    0.0.0.0:3389           0.0.0.0:0              LISTENING       1380
  TCP    192.168.11.193:9434    192.168.11.155:3389    ESTABLISHED     4088
  TCP    192.168.11.193:11526   192.168.11.214:3389    ESTABLISHED     4088
  TCP    [::]:3389              [::]:0                 LISTENING       1380
  UDP    0.0.0.0:3389           *:*                                    1380
  UDP    [::]:3389              *:*                                    1380
PS C:\Users\chancel> tasklist|findstr "1380"
svchost.exe                   1380 Services                   0     15,464 K
chrome.exe                   13808 Console                    1     13,440