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
powershell
cmd
(add -n to stop it trying to resolve hostnames, which will make it a lot faster)
Note Dane's recommendation for TCPView. Looks very useful!
-a Displays all connections and listening ports.
-b Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.
-n Displays addresses and port numbers in numerical form.
-o Displays the owning process ID associated with each connection.
To find out which specific process(PID) is using which port:
Where 1234 is the PID of your process. [Go to Task Manager -> Services/Processes tab to find out the PID of your application]
It is very simple to get the port number from pid in windows.
The following are the steps:
1) Go to run --> type cmd --> press enter.
2) write the following command...
(Note: Don't include square brackets.)
3) press enter...
4) Then cmd will give you the detail of the service running on that port alongwith pid.
5) Open task manager and hit the service tab and match the pid with that of the cmd and that's it.
netstat -ao
andnetstat -ab
tell you the application, but if you're not admin you'll get "The requested operation requires elevation".It's not ideal, but if you use sysinternals Process Explorer you can go to specific processes' properties and look at the TCP tab to see if they're using the port you're interested in. Bit of a needle and haystack thing, but maybe it'll help someone....
Open a command prompt window (as Administrator) From "Start\Search box" Enter "cmd" then right-click on "cmd.exe" and select "Run as Administrator"
Enter the following text then hit Enter.
netstat -abno
-a Displays all connections and listening ports.
-b Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.
-n Displays addresses and port numbers in numerical form.
-o Displays the owning process ID associated with each connection.
Find the Port that you are listening on under "Local Address"
Look at the process name directly under that.
NOTE: To find the process under Task Manager
Note the PID (process identifier) next to the port you are looking at.
Open Windows Task Manager.
Select the Processes tab.
Look for the PID you noted when you did the netstat in step 1.
If you don’t see a PID column, click on View / Select Columns. Select PID.
Make sure “Show processes from all users” is selected.
First we find process id of that particular task which we need to eliminate in order to get port free
type
netstat -n -a -o
After executing this command in windows command line prompt(cmd) select the pid which i think the last column suppose this is 3312
Now type
taskkill /F /PID 3312
You can now cross check by typing netstat command.
NOTE: sometimes windows doesn`t allow you to run this command directly on CMD so first you need to go with this steps from start-> command prompt (right click on command prompt, and run as administrator)