Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On Linux we can kill an Established TCP Connection using tcpkill command.


For example, to drop all connection to/from a particular IP:

tcpkill host ipaddr

Or similary to kill all connection using port 21 at ethernet-1, by:

tcpkill -i eth1 port 21  

Similarly, i want to know what is the command to kill certain connection on windows, precisely windows 7. Like i can see a list of active connections by netstat -n, now i am wondering how to drop a particular or group of connections?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

The CurrPorts tool from Nirsoft seems to do that. Follow the link and search for 'Closing a Connection From Command-Line'.

share|improve this answer
    
thanks, it seems to have licensing issues, dosen't look like free to me –  Johnydep Feb 2 '12 at 16:13
    
from the product page: "This utility is released as freeware. You are allowed to freely distribute this utility via floppy disk, CD-ROM, Internet, or in any other way, as long as you don't charge anything for this. If you distribute this utility, you must include all files in the distribution package, without any modification !" that seems pretty free to me. –  Peter Hahndorf Feb 2 '12 at 17:34

The Windows Sysinternals Suite contains a tool called TcpView. TcpView will show you all of the connections on your machine similar to netstat. It will also allow you to close the connection or kill the process hosting the connection.

share|improve this answer
    
thanks but I am more interested in something that is available as command line options because i need to integrate that in my application. I looked at Tcpvcon.exe which is shipped with Tcpview but i do not know how to close connection using that. Since on GUI, we simply right click and close connection, wondering how to do the same for this command line tool? Any idea/ –  Johnydep Feb 1 '12 at 14:34
    
If you need to do it programmatically, use a Windows api. –  ZippyV Feb 1 '12 at 15:22
    
@ZippyV, which API i should be looking at? –  Johnydep Feb 2 '12 at 16:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.