Get process name from port-number (Windows)

Sometimes when you try to start a process/application (mostly observed during server start ups), we get exception/error saying xxxx port is in use cannot start process/application.
Sometimes I get this exception while starting application servers like JBoss, WebSphere, WebLogic, etc and even sometimes with DB servers installed on my machine. This is even possible while starting a LAN Game, so here is short, smart solution. 

Actual problem here is we might not be aware of which process is using this port, i.e. which process to kill(if not critical).

Use following commands to get to know - 
>>netstat -ano | findstr 

which gives you PID (Process ID) number,
use this number to get process name - 
>>tasklist | findstr PID

OR to get complete status about process, you can run
(If you are running UNIX-based Applications on windows then few UNIX commands e.g.grep to would have been added to the Windows command shell)
>>ps -ef|grep PID

This will give you name of process which is using the respective port.
Next part is to kill it through Task-manager or through command - 

(By using PID)
>>taskkill /PID 827

(By Using Process name)
>>taskkill /IM notepad.exe

More details about how to use each of above commands can be easily found out by "____|more" command.

Comments

Popular posts from this blog

How to install / Configure Mantis For Apache-PHP-PostgreSQL combination

Modified ExtJS LOVCombo (List of Values) ux plugin - with select all, deselect all, text filter, bubble up and bubble down of selection

TriggerField with two triggers, TwinTriggerField with tooltips