win关闭某端口

//查看本机开放端口,TIME_WAIT代表进程正在改变,LISTENING需要手动关闭
C:\Users\17273>netstat -an

活动连接

  协议  本地地址          外部地址        状态
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:443            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:903            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:913            0.0.0.0:0              LISTENING
//查看端口进程号
C:\Users\17273>netstat -ano | findstr 135
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       552
//关闭端口
tasklist | findstr 552
//强制关闭端口
taskkill -PID 552 -F 

猜你喜欢

转载自blog.csdn.net/weixin_44664530/article/details/106237371