How to determine which program is using a given port in Windows.

Issue

A newly installed program does not run and could be using a port on the host computer that's already assigned to another running program or service.  How can current port usage on the host computer be determined quickly?

Product Line

TAC I/NET, TAC Vista, Andover Continuum, Satchwell MicroNet, Satchwell Sigma, TAC I/A Series, Field Devices, SmartStruxure Solution, Other, Pelco Cameras, Pelco Monitors, Pelco Video Management, Pelco Matrix, Pelco Transmission & Power, SmartStruxure Lite

Environment

MicroSoft Windows XP, Vista, Windows 7

Cause

A port conflict is suspected.

Resolution

Open a command prompt and type:

  • netstat -a -n -p tcp -b
    This command will display all services running, protocol used, local and foreign address, state, and program name.
     
  • netstat -p tcp -ano
    This command will display all services running, protocol used, local and foreign address, state and PID (process identifier).
    Use Task Manager to match the PID to the program using the port.
  • netstat -p tcp -ano | findstr :80
    If a specific port number is necessary, this command will interrogate the system for the program currently using that port number: