netstat -ano | findstr :your_port_number
This article is focused to solve problem, how to find all processes ids (PIDs) that listen on specific ports under Windows CMD (Windows Command). Simple solution how to find opened ports with netstat command is described below.
netstat command example
This solution shows composition of two programs.
netstat lists and prints all processes and
findstr finds lines that contain
:80 text. Redirection beetwen proceses with pipe (
|) causes that only specific lines will be printed - lines with text passed in first argument of
Programs usage in cmd:
C:\>netstat -ano | findstr :80
-adisplays all connections and listening ports,
-ndisplays addresses and port numbers in numerical form,
-odisplays the owning process ID associated with each connection.
:80is searching phrase in each line - printed lines contain it.