How to delete binded port from cmd in Windows 7?

37,857

Solution 1

TCP Ports cannot be deleted, you must close the program that has bound itself to that port.

To find out what program is bound to a port use netstat -ab

 TCP    127.0.0.1:27015        Thiscomputer:0             LISTENING
 [AppleMobileDeviceService.exe]

See How to find exe listening on port?

Try netstat with -o, it shows PID. and then use tasklist to see PID and process name. task manager also shows PID and process name

   TCP    127.0.0.1:27015        bcs:49177              ESTABLISHED     1588  
   [AppleMobileDeviceService.exe]

Task Manager context menu
Using right-click context menu in Task-Manager

Solution 2

To kill process on windows run below command to find port and pid

netstat -ano

to kill a process

taskkill /F /PID 1448
Share:
37,857

Related videos on Youtube

Amal S R
Author by

Amal S R

Updated on September 18, 2022

Comments

  • Amal S R
    Amal S R over 1 year

    How to delete binded port in Windows 7 from cmd? I'm developing client server application which running on the port 3434 and also is binded on port 0.0.0.0. When I type in cmd netstat -an, I get this output:

      TCP    0.0.0.0:3434           0.0.0.0:0              LISTENING
    

    I can't get ride of them cause don't know the name of port. This link didn't help me, so can you?

    • JdeBP
      JdeBP over 12 years
      What, exactly, are you trying to get rid of? You've run a server application to listen on a TCP port, and netstat has told you that you have an application listening on a TCP port. What's the thing that you are trying to delete, precisely?
    • Amal S R
      Amal S R over 12 years
      Precisely, delete listening port.
    • JdeBP
      JdeBP over 12 years
      Your providing the same three word non-explanation a second time doesn't clarify things. What are you trying to do? What has the computer done? And why do you think that that's in error?
    • Amal S R
      Amal S R over 12 years
      Let's say that you want to close telnet server on 23 port, you will close telnet server or type something like: netsh advfirewall firewall delete rule name="telnsrv.exe" port=23 ... OK! Now think that you don't know the name of telent ("telnsrv.exe"), you just know the port on which some crashed program was run (TCP 127.0.0.1 Thiscomputer:0 LISTENING [system]). How that to put those port in function? How to free those port? (that you can run again program on same port)
  • Amal S R
    Amal S R over 12 years
    How to delete this, don't have any .exe: TCP 0.0.0.0:3434 nova:0 LISTENING [System]
  • Amal S R
    Amal S R over 12 years
    yes thnx for labor, ... but program has run and it was closed, and now when I'm searching for process or name of program don't see anything ... I will trust restart and than try again ...
  • user5249203
    user5249203 over 12 years
    @IvanPericic: See updated answer (and related Q)
  • Amal S R
    Amal S R over 12 years
    I try to restart but same thing, ... still I can't see the name of program just [System] and when trying to end process on him nothing happen .... Probably because my test application has crashed and port that has binded still stayed open.
  • Amal S R
    Amal S R over 12 years
    OK ... just to say I try to restart one more time and restart explorer with: cmd /c taskkill /f /im explorer.exe & start explorer.exe ... and those probably refresh some configuration, and now when put: netstat -an in cmd doesn't see 3434 port anymore... thxn again