How can you find out which process is listening on a port on Windows?
相关问题
- Inheritance impossible in Windows Runtime Componen
- IPAddress.[Try]Parse parses 192.168 to 192.0.0.168
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- RMI Threads prevent JVM from exiting after main()
- CosmosDB emulator can't start since port is al
- fsc.exe is very slow because it tries to access cr
For Windows, if you want to find stuff listening or connected to port 1234, execute the following at the cmd prompt:
Type in the command:
netstat -aon | findstr :DESIRED_PORT_NUMBER
For example, if I want to find port 80:
netstat -aon | findstr :80
This answer was originally posted in this thread.
If you'd like to use a GUI tool to do this there's SysInternals TCPView.
The -b switch mentioned in most answers requires you to have administrative privileges on the machine. You don't really need elevated rights to get the process name!
Find the pid of the process running in the port number (e.g., 8080)
Find the process name by pid
Get PID and Image Name
Use only one command:
where
9000
should be replaced by your port number.The output will contain something like this:
Explanation:
it iterates through every line from the output of the following command:
from every line, the PID (
%a
- the name is not important here) is extracted (PID is the5
th element in that line) and passed to the following commandIf you want to skip the header and the return of the command prompt, you can use:
Output:
For those using Powershell, try
Get-NetworkStatistics
: