- How to Check for Ports in Use in Windows 10
- Use Nirsoft CurrPorts
- Command Prompt Method
- TCPView
- Information Security Squad
- 🔍 Какой процесс прослушивает порт на Windows?
- Как узнать, какой процесс прослушивает определенный порт в операционной системе Windows?
- 1. Использование командной строки
- 2. Использование PowerShell Get-Process
- Заключение
- How do I determine which process is using a serial port?
- 3 Answers 3
- How to Check Which Process Is Using Port 8080 or Any Other Port (and Vice Versa) on Windows
- Learn how to see which process or application is using a particular port, and likewise, which port is being used by a particular process.
- 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
- Explanation
- netstat -aon
- findstr 8080
- Step 2 — Find the Process/Application Name Using the Given Port Using the Process id Found in Step 1
- Syntax
- 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
- Step 2 — Find the Port Being Used by the Process id Found in Step 1
- Summary
- Find the PID of a process that uses a port on Windows
- 7 Answers 7
How to Check for Ports in Use in Windows 10
At any one time, there’s a whole bunch of information being sent between your Windows 10 PC and the endless void of the Internet. This is done using a process whereby network-dependent processes seek out TCP and UDP ports, which they use to communicate with the Internet. First, your data gets sent to remote ports at the destination or website your processes are trying to connect to, then it gets received at local ports back on your PC.
Most of the time, Windows 10 knows how to manage ports and ensure that traffic is being directed through the right ports so that those processes can connect with what they need to. But sometimes two processes may be assigned to one port, or maybe you just want to get a better picture of your network traffic and what’s going in and out.
That’s why wrote this guide that shows you how to get an overview of your ports and see which applications are using which ports.
Use Nirsoft CurrPorts
NirSoft is one of the best indie software developers, giving us great utilities, like PassView and WirelessKeyView. While some people will prefer checking their ports without installing third-party software (in which case, scroll down to the CMD method), CurrPorts is easily the fastest and most convenient way to view your ports.
Once you’ve installed CurrPorts, just open it to see a list of all your ports currently in use. If you’re looking for local ports in use, just click the “Local Port” column at the top to order the list by port number (handy if you’re looking for a specific one). You can do the same thing with remote ports, too.
If you want to really find specific ports, click the “Advanced Filters” icon at the top and enter your string in the format they suggest. It should look something like the below image.
Hit OK when you’re ready, and the list will filter down to your queries.
Command Prompt Method
The integrated – though not necessarily the simplest – way to check open ports is to use the trusty command prompt.
Click the Start button, type cmd , then right-click “Command Prompt” when it shows up in the search results. Click “Run as administrator.”
Once you’re in the elevated command prompt, enter the following command:
This will steadily bring up a list of ports that is probably quite long, along with the Windows processes that are using them. (You can press Ctrl + A , then Ctrl + C to copy all information to the clipboard.) On the average PC, there will be two main local IP addresses that contain ports on your PC.
The first, in our case, is “127.0.0.1.” This IP address is otherwise known as “localhost” or a “loopback address,” and any process listening to ports here is communicating internally on your local network without using any network interface. The actual port is the number you see after the colon. (See image below.)
The bulk of your processes will probably be listening to ports prefixed with “192.168.xxx.xxx,” which is your IP address. This means the processes you see listed here are listening for communications from remote Internet locations (such as websites). Again, the port number is the number after the colon.
TCPView
If you don’t mind installing a third-party app and want to have more control over what’s going on with all your ports, you can use a lightweight app called TCPView. This immediately brings up a list of processes and their associated ports.
What make this better than the command prompt is that you can actively see the ports opening, closing and sending packets. Just look for the green, red and yellow highlights. You can also reorder the list by clicking the column headings, making it easier to find the process you want or two separate processes vying for the same port.
If you do find a process or connection you want to close, just right-click that process. You can then select “End process,” which is exactly the same function as the one in Windows task manager. Or you can click “Close Connection” to leave the process open but stop it from listening on a given port.
If you’re having some trouble in Windows 10, then see whether a Windows update may be causing it. We also have a handy guide for managing the health of your hard drive in Windows 10.
Related:
Content Manager at Make Tech Easier. Enjoys Android, Windows, and tinkering with retro console emulation to breaking point.
Information Security Squad
stay tune stay secure
- Home
- 2020
- Октябрь
- 29
- 🔍 Какой процесс прослушивает порт на Windows?
🔍 Какой процесс прослушивает порт на Windows?
Как узнать, какой процесс прослушивает определенный порт в операционной системе Windows?
Эта статья поможет вам найти имя процесса, прослушивающего определенный порт в системе Windows.
Иногда при установке приложения вы могли столкнуться с проблемой типа «port in use».
Вы можете выбрать один из двух способов, указанных ниже.
Первый метод использует netstat, чтобы найти pid процесса, прослушивающего определенный порт, затем используется список задач, чтобы найти имя процесса по pid.
1. Использование командной строки
Используйте следующую команду, чтобы узнать идентификатор процесса (pid), прослушивающий порт 433 .
Вы можете изменить это значение для поиска другого порта.
В последнем столбце выходных данных отображается идентификатор процесса.
Приведенный выше вывод показывает, что pid равен 2189 и 4620 для процессов, прослушивающих порт 443.
Используйте этот идентификатор процесса с командой списка задач, чтобы найти имя процесса.
В результатах вы увидите имя процесса, как показано на скриншоте выше.
2. Использование PowerShell Get-Process
Второй метод использует команду PowerShell для определения процесса, запущенного на определенном порту в Windows.
Запустите терминал PowerShell и выполните следующую команду, чтобы найти имя процесса, работающего на порту 443.
Вы можете изменить номер порта, чтобы проверить наличие других портов.
В результатах вы увидите имя процесса, как показано на скриншоте выше.
Заключение
В этом руководстве вы узнали два метода поиска имени процесса, прослушивающего определенный порт в системе Windows.
How do I determine which process is using a serial port?
The company I work for makes hardware that communicates to the computer though a serial port. Third party companies write software that communicates with our hardware.
There are times when I need to diagnose our hardware. However, a third party software app connects to the serial port when Windows starts up, blocking any other connection. I don’t know the name of this application/service and it’s not always the same one.
Is there any way to either:
- Find the name/pid of the app/service that is currently using a given serial port or
- Steal the serial port connection from another app.
vb.net preferably, but I’ll take a language agnostic answer as well.
3 Answers 3
You can use the process explorer tool also from SysInternals to search for open handles. In this case you would want to search for ‘Serial’ since it uses device names that may not map to com port numbers. (e.g. COM1 is \Device\Serial0 on my system).
If you want to take control of the serial port from another app I think you would need co-operation of the driver.
As Rob Walker said, you can find who’s using a serial port using Process Explorer. Most of the time, typing Ctrl + F and searching for «serial» will show you who has a serial port open, but I just ran into a situation where my «COM3» serial port’s handle appeared as «\Device\VCP0». It may be strange because it was running under VirtualBox with a USB-to-serial connector.
If searching for «serial» and «device\vcp» don’t get you any results, you may be able to figure out how serial port handles are named by opening one with a known program. In Process Explorer, display the lower pane with each process’s open handles by typing Ctrl + L . Click on the process that you used to open the serial port and look through the lower pane to see which handles look like they might be a serial port. You can open and close the port while you’re looking, and the file handle should appear and disappear, as well as being highlighted in green or red. Of course, this is only possible if you have more than one serial port or the serial port you’re trying to diagnose isn’t always locked by some mystery process.
Sysinternals has a slew of utilities I find very useful and educational for tracking down what processes are doing to the system.
They have a utility that does exactly what you need called Portmon, and give some information on how it works near the bottom of the page. That info and a few well-asked questions will probably give you everything you need to implement it yourself if the utility isn’t enough.
How to Check Which Process Is Using Port 8080 or Any Other Port (and Vice Versa) on Windows
Learn how to see which process or application is using a particular port, and likewise, which port is being used by a particular process.
Join the DZone community and get the full member experience.
Hello friends. In this tutorial, you will learn
- How to check which process/application is using a particular port on Windows
- How to check which port is being used by a particular process/application on Windows
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
-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
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
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.
Summary
In this tutorial, you learned
Use of the netstat command with -aon options together with the findstr command to find out which process is using a particular port, and vice versa.
Thanks for reading. Share it with someone you think it might help.
Published at DZone with permission of Gaurav Bhardwaj . See the original article here.
Opinions expressed by DZone contributors are their own.
Find the PID of a process that uses a port on Windows
My service crash on startup with the classic:
How can I find the process for killing it?
7 Answers 7
Just open a command shell and type (saying your port is 123456):
You will see everything you need.
The headers are:
Find the PID of a process that uses a port on Windows (e.g. port: «9999»)
-a Displays all connections and listening ports.
-o Displays the owning process ID associated with each connection.
-n Displays addresses and port numbers in numerical form.
Then kill the process by PID
/F — Specifies to forcefully terminate the process(es).
Note: You may need an extra permission (run from administrator) to kill some certain processes
Command:
Output:
Now cut the process ID, «10396», using the for command in Windows.
Command:
Output:
If you want to cut the 4th number of the value means «LISTENING» then command in Windows.
Command:
Output:
If you want to do this programmatically you can use some of the options given to you as follows in a PowerShell script:
However; be aware that the more accurate you can be the more precise your PID result will be. If you know which host the port is supposed to be on you can narrow it down a lot. netstat -aon | findstr «0.0.0.0:9999» will only return one application and most llikely the correct one. Only searching on the port number may cause you to return processes that only happens to have 9999 in it, like this:
The most likely candidate usually ends up first, but if the process has ended before you run your script you may end up with PID 12331 instead and killing the wrong process.