Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a hack for internal purposes whereby I want to disconnect a program from it's socket without killing the process. For example, program A (running xxx.exe) is running on port 50000 and I want to stop that association and (so that I could theoretically use that port for something else). How would I do this in Windows 7 while keeping the EXE running?

NOTE: the program runs javaw.exe

share|improve this question

Well one easy way is to use TCPView or CurrPorts. They display a list of network connections and the programs that have them open. You can right-click them and select close to forcibly close the connection without killing the program.

Make sure to "run them as administrator" because this sort of action requires elevated privileges.

NB: while closing the connection does not inherently kill the program, there is always the possibility that it can crash. It is the same as closing a program's handle to a file/directory; the program remains running but may crash.

share|improve this answer
Good thought - I downloaded and tried this method with TCPView and it seemed to not allow this disconnection. Trying the other one now. – nicorellius Jun 4 '12 at 18:19
Tried CurrPorts as well. Both apps don't seem to disconnect. They both have options to disconnect from the port, but when this option is selected, nothing seems to happen and the program, upon refresh, is still running and attached to the same port. – nicorellius Jun 4 '12 at 18:27
You need to run them as administrator. – Synetech Jun 4 '12 at 18:34
I did, in both cases, run them as administrator... – nicorellius Jun 4 '12 at 18:43
Try turning UAC off, running them, then back on. Also, what exactly happens when you select close? Does the status of the connection change? Maybe the program is simply detecting the lost connection and reestablishing it. – Synetech Jun 4 '12 at 18:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .