Languages
[Edit]
EN

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

9 points
Created by:
Kate_C
2854

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?
Hey ūüĎč
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.