Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA
  • Practice Problems
  • Python
  • C
  • C++
  • Java
  • Courses
  • Machine Learning
  • DevOps
  • Web Development
  • System Design
  • Aptitude
  • Projects
Open In App
Next Article:
How to use CMD for Python in Windows 10?
Next article icon

How to Check Open Ports Using CMD in Windows?

Last Updated : 09 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Open ports on your Windows computer act like doors for data-letting information in and out. While necessary for apps and services, unprotected ports can become security risks. Checking which ports are open helps you spot vulnerabilities, fix connection issues, and keep your system safe.

Using Command Prompt (CMD), you can quickly see active ports with simple built-in commands—no extra tools needed. This guide walks you through the steps to check open ports in Windows, understand the results, and close any unnecessary ones.

Whether you’re troubleshooting a network problem or guarding against threats, these CMD techniques give you control over your system’s security.

How-to-Check-Open-Ports-Using-CMD-in-Windows
How to Check Open Ports Using CMD in Windows

How to Check Open Ports Using CMD in Windows

Make sure that the essential ports are allowed or blocked by your firewall system configuration. The Control Panel's Windows Firewall settings allow you to control all the initial processes for system requirements. If you discover the open ports that ought to be closed within the system, you might want to halt the related service or change the in-build configuration of the program that opened the port manually.

Now, see the below-mentioned steps and implement them to Check Open Ports Using CMD in Windows.

Step 1: Open CMD or Command Prompt

  • Press Win + R from your keyboard > Type cmd > Click on the Enter button
cmd_1
Open CMD

Step 2: Implement the "netstat" Command

An effective tool for keeping an eye on open ports within the system and configured network connections is the netstat command to simplify. It offers comprehensive details on all open connections and system servers, such as the protocol in use, and local and international addresses to control or verify all the connection's status.

  • Type the below command in the cmd to check the open port functions > Press Enter
netstat -an | find "LISTEN"
cmd_2
netstat
  • See the output below
TCP    0.0.0.0:135        0.0.0.0:0        LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:902 0.0.0.0:0 LISTENING
cmd_3
netstat list

In this case, 0.0.0.0 designates that all pre-processed network interfaces are listening on the port, which is open for the internal system server. The port number is the number that comes after the colon of the system commands (e.g., 135, 445, 3389).

Step 3: Observe the functional Process Using the Port

  • Write the following command to identify which application or process is using a specific port within the system.
netstat -ano | find "LISTEN"
cmd_4
LISTEN

An extra -o flag is included with this command while processed, which shows the Process ID (PID) connected to each port manually.

  • See the output within a PID column
TCP    0.0.0.0:135        0.0.0.0:0        LISTENING      1160
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
  • Search and Open Task Manager > Go to Details option > See the PID column
cmd_5
LISTEN LIst

Step 4: Check Specific Port in cmd

  • You can change the implemented command to focus on a particular port if you want to see if it's open or not within the system configuration. For instance, use this to see if port 60 is open to identify the process:
netstat -an | find ":60"
  • See the final entry below -
cmd_6
find entry
TCP    0.0.0.0:40         0.0.0.0:0        LISTENING
cmd_7
find ports

Conclusion

Using Windows' CMD to check all the internal open ports is a simple yet effective method for network management, security control, and troubleshooting issues identification. You can safeguard your system from external potential dangers and make sure your connected network is operating efficiently by routinely checking open ports within the system. The netstat command is an invaluable resource for any IT professional or developer toolset, especially when paired with a basic understanding of ports and processes of all the initial implementations.

Also Read

  • How to check Active Network Connections in Windows?
  • Ways to Find Out List of All Open Ports in Linux

Next Article
How to use CMD for Python in Windows 10?
author
arponkumarchowdhury34
Improve
Article Tags :
  • TechTips
  • Command Prompt
  • Windows Hacks

Similar Reads

  • How to Open Google Chrome Using CMD on Windows 11?
    Opening Google Chrome using CMD in Windows 11 is a convenient way to launch the browser without needing to use the graphical interface. Whether you're troubleshooting or simply prefer using the command line, this guide will show you how to run Chrome via CMD on Windows 11. The steps are easy and can
    4 min read
  • How to Open Command Prompt in Windows 11, 10, 8, 7
    The Command Prompt is a powerful tool in Windows for executing commands, troubleshooting issues, and automating tasks. Whether you're using Windows 11, 10, 8, or 7, this guide covers all the methods to open Command Prompt quickly and efficiently. 8 Proven Methods to run the Command Prompt (cmd) in W
    8 min read
  • How to use CMD for Python in Windows 10?
    Using the Command Prompt (CMD) is an effective way to interact with Python on your Windows 10 machine. Whether you're writing scripts, testing code, or running programs, mastering CMD for Python in Windows 10 is crucial. This article will guide you on how to run Python in CMD, execute scripts, and t
    4 min read
  • How to Open Windows PowerShell as an Admin in Windows 11?
    Windows Powershell is a powerful command-line shell and scripting language devised for administrators and professionals. PowerShell with administrative privileges in Windows 11 makes it possible to carry out tasks with superior permissions. This article will discuss several ways of opening Windows P
    4 min read
  • How to Check DNS Records Using Basic NsLookup CMD?
    The NsLoookup command is a utility that can be used when trying to troubleshoot problems with networking or test DNS configurations. It allows querying the DNS server for domain information, such as which IP addresses are associated with it, mail server information, and other DNS records DNS, or Dom
    5 min read
  • How to Find Connected WiFi Password in Windows?
    If you're connected to a WiFi network but can't remember the password, don't worry—Windows allows you to retrieve it easily. Whether you need to connect a new device or share the password with someone else, finding the connected WiFi password in Windows is a straightforward process. This guide will
    3 min read
  • How to Install or Uninstall a Windows Service in C#?
    Windows Services is a core component of the Microsoft Windows NT operating system that allows the creation and regulation of processes. Windows Services can start without user intervention and may continue to run long after the user has logged off. Windows services run in the background of the OS an
    3 min read
  • How to check Active Network Connections in Windows?
    There could be instances where we need to check our current network connectivity or sometimes troubleshoot a particular connection. We can follow a few simple steps to check the active connections. We also have some predefined commands that when entered in command prompt give a detailed explanation
    3 min read
  • How to Get Open Port Banner in Python
    In this article, we will see how to Get Open Port Banner in Python. Here we will discuss  What is Port? Port is a terminology used on computer networks. You might know, that whenever you connect to the internet, your system or any device to which you are connecting is assigned an IP address.  So, wh
    4 min read
  • How to Upgrade PowerShell in Windows
    Upgrading PowerShell on Windows ensures access to new commands, enhanced security features, and better compatibility with modern scripts and tools. Whether you’re using it for system administration, automation, or development, staying up to date can make a significant difference. In this guide, we’l
    6 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences