Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing a TCP port via DOS command ????? 1

Status
Not open for further replies.

pbxphoneman

Technical User
Oct 4, 2002
104
Is there a simple way to close a TCP port via a DOS command even if it's for a short time?
While installing DSL routers for customers I'll encounter PC's that are infected with spyware/virus's. I'll do a NETSTAT and see a foreign address that is causing the problem....is there a way to close that connection even for a short time? To cause the machine to go back to a listening state for a short time till it (the spyware or virus) opens it up again (long enough for me to get to the free norton antivirus scan site and prove to the customer that they need a virus program).I have been rebooting the modem to get around this problem,but it's getting old.
most machines are either 98 or XP.

 
To close the TCP port, you need to shutdown the process that has the port open. If using XP, use the netstat -ano command to show you the PID that has the port open, then use task manager to kill the process at that PID.

You can use Sysinternals freeware utility, tcpview ( on Windows 98 to do the same thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top