Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Windows Tutorials»Which Process is Listening on a Port in Windows

    Which Process is Listening on a Port in Windows

    By RahulApril 12, 20233 Mins Read

    If you’re a system administrator, you know how important it is to keep an eye on the processes running on your Windows system. Sometimes, you may need to find out which process is listening on a particular port. In this article, we’ll show you how to do that using both CMD and PowerShell.

    By learning how to identify the process listening on a port, you can troubleshoot network-related issues more effectively and take necessary actions to fix them.

    Method 1. Using Command Prompt

    Use the following command to find out the process id (PID) listening on port 80. You can change this port to search for another port.

    netstat -aon | findstr ":80" | findstr "LISTENING" 
    
    Output:
    TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4 TCP [::]:80 [::]:0 LISTENING 4

    The output will show you the process ID (PID) of the process listening on the specified port. You can then use the Task Manager to find the process using the PID.

    Use this process id with the task list command to find the process name.

    tasklist /fi "pid eq 4" 
    

    You will see the process name in the results.

    Which Process is Listening on a Port in Windows
    Finding the process listening on specific port in Windows

    Method 2. Using PowerShell

    The second method uses the PowerShell command to find out the process running on a specific port on Windows.

    Launch the PowerShell terminal and execute the following command to find the process name running on port 80. You can change the port number to check for other ports.

    Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess 
    

    The output will show you the process ID (PID) of the process listening on the specified port. You can then use the Task Manager to find the process using the PID.

    How to Check Process Name by Port in PowerShell
    Checking the process name running on specific port

    Conclusion

    In conclusion, identifying the process listening on a port is a useful skill for system administrators, especially when troubleshooting network-related issues. In this article, we’ve shown you how to do that using both CMD and PowerShell.

    By using CMD, you can use the netstat command to find out which process is listening on a port. In PowerShell, you can use the Get-NetTCPConnection cmdlet to achieve the same result.

    With these tools at your disposal, you can quickly identify the processes that are listening on specific ports on your Windows system and take necessary actions to fix any issues that may arise. So, next time you need to troubleshoot network-related issues, try using CMD or PowerShell to identify the processes listening on specific ports, and see how it can make your job easier.

    command-line port PowerShell process windows
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    A Step-by-Step Guide to Installing Nginx on Windows

    Creating Timestamped Files and Directories in PowerShell: A Step-by-Step Guide

    PowerShell Script to Backup SQL Server Databases

    View 1 Comment

    1 Comment

    1. Devid A on January 1, 2022 11:25 am

      Thanks for sharing informative content!

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Difference Between Full Virtualization vs Paravirtualization
    • Virtualization vs. Containerization: A Comparative Analysis
    • Using .env Files in Django
    • Using .env File in FastAPI
    • Setting Up Email Notifications for Django Error Reporting
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.