Ticker

6/recent/ticker-posts

Advertisement

How to Check Which Process/Application Is Using a Particular Port on Windows

Step 1 - Find the Process id of the Process Using the Given Port

Syntax

 netstat -aon | findstr<port_number>  


-a Displays all connections and listening ports.


-o Displays owning process Id associated with each connection.


-n Displays addresses and port numbers in numerical forms


On my system, it displays the following output. My Tomcat is up and running on port 8080 within Eclipse and I executed the following command.


 netstat -aon | findstr 8080 


Here the last column is telling the process id of the process which is using port 8080.


Explanation

netstat -aon

Will give you a list of process Ids which are using given port.


findstr 8080

findstr is functionally equivalent to grep command on Linux. From the output of netstat, findstr will give the lines which have word 8080 in it.


Step 2 - Find the Process/Application Name Using the Given Port Using the Process id Found in Step 1

Syntax

 tasklist | findstr <PID> 


This will give you the application name which is using that port.


On my system, I used the following command to check which process belongs to process id 9260.


 tasklist | findstr 9260 




Here, javaw.exe is the process which is using port 8080.


How to Check Which Port Is Being Used by a Particular Process/Application on Windows

Step 1 - Find the Process id of the Process Using a Process With the Given Name

Syntax

 tasklist | findstr <application_name/process_name>   


On my system, I executed the following command to find first process id of a process with name javaw.exe


 tasklist | findstr javaw.exe 




Here, 9260 is the process id of the process javaw.exe.


Step 2 - Find the Port Being Used by the Process id Found in Step 1

On my system, to find which port is being used by a process with process id 9260, I run


 netstat -aon | findstr 9260 




As you can see in the above output, process 9260 is using port 8080.

Post a comment

0 Comments

';

Video Of Day

Featured

Sponsor

Pages