Trash Talk - How to close connections from command prompt? K' - Tue Sep 26, 2006 12:25 pm Post subject: How to close connections from command prompt?
It's boggling the hell out of me.
So I can netstat to fish for TCP or UDP connex.
But how do I go about wiping them out?
netsh?
K' - Tue Sep 26, 2006 12:57 pm Post subject:
OMFG YOU CAN"T!
WTF IS WRONG WITH OS MAKERS?
I've stirred a dozen people and they say you can't do it from command prompt.
THAT"S JUST SO DAMN !@#$%
Solo Ace - Tue Sep 26, 2006 2:32 pm Post subject: You should try messing for a bit with the netsh command. It might be possible to just turn the firewall off and reject/close connections based on ports/proto.
I'm not sure if this would work, though.
Wouldn't it be possible to use a sniffing library like winpcap to capture a stream and just return a connection error to close the connection?
I'm not sure, I have no clue really.
...I've asked Google for a bunch of pages, and I looked through Sysinternals.
Sysinternals shows that TCPView can actually kill TCP connections, but not through commandline, and the source of that project isn't available.
After Googling some more I found that SetTcpEntry could get you to kill a connection.
Here are some (hopefully) useful resources:
Enetstat (The Code Project) <-- This entry might be useful to you.
SetTcpEntry (Windows SDK)
This is all for TCP it seems, I guess that's because UDP isn't really a "connection".
Oh right before posting I saw you already got using netsh as an idea.
K' - Wed Sep 27, 2006 6:31 am Post subject:
Well, thing is, I wanted a native command prompt batch.
I can do it just fine via any third party app, tool, firewall, whatever.
There are even command line add-on plugs/apps that can allow me to kill connections.
But I wanted something that's native.
Seems that, essentially, both unix and windows fail at that.
I'm most disappointed.
After all, it's such a trivial thing in our modern daily reality.