Languages
[Edit]
EN

Windows - how to list all processes that use specific port with cmd?

12 points
Created by:
JustMike
31190

Quick solution:

netstat -ano | findstr :your_port_number

1. Introduction

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.

2. 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 findstr.

Programs usage in cmd:

C:\>netstat -ano | findstr :80
netstat listing processes that uses port 80 - Windows CMD
netstat listing processes that uses port 80 - Windows CMD

 

Where:

  • for netstat:
    • -a displays all connections and listening ports,
    • -n displays addresses and port numbers in numerical form,
    • -o displays the owning process ID associated with each connection.
  • for findstr:
    • :80 is searching phrase in each line - printed lines contain it.

See also

  1. Windows - how to kill process that listen on specific port with cmd?

Alternative titles

  1. Windows - how to list all processes that use the port with netstat?
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join