How to close TCP and UDP ports via windows command line

后端 未结 17 1608
忘掉有多难
忘掉有多难 2020-12-07 06:43

Does somebody knows how to close a TCP or UDP socket for a single connection via windows command line?

Googling about this, I saw some people asking the same thing.

17条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 07:20

    1. open cmd

      • type in netstat -a -n -o

      • find TCP [the IP address]:[port number] .... #[target_PID]# (ditto for UDP)

      • (Btw, kill [target_PID] didn't work for me)

    2. CTRL+ALT+DELETE and choose "start task manager"

      • Click on "Processes" tab

      • Enable "PID" column by going to: View > Select Columns > Check the box for PID

      • Find the PID of interest and "END PROCESS"

    3. Now you can rerun the server on [the IP address]:[port number] without a problem

提交回复
热议问题