...
Line
Skip to main content
< All Topics
Print

How to check if a port is open on a Windows machine?

Using Command Prompt:

  • Open Command Prompt.
  • Use the netstat command with the -an flag to display all active connections and listening ports:

netstat -an | find “PortNumber”

If the port is active, you will see a response in the following way and If the port is not active nothing will be shown.

Here 6280 is not active and 3306 is active

Using PowerShell:

  • Open PowerShell.
  • Use the Test-NetConnection cmdlet to check if a port is open:

Test-NetConnection -ComputerName <ComputerName> -Port <PortNumber>

If you don’t know the ComputerName, You can find that under your computers about. (Right-click on This PC and click on properties)

Below you can see that TcpTestSucceeded is False for 6280 so it’s not active and TcpTestSucceededis True for 3306 and it’s active.

Using Telnet:

  • Telnet is not enabled by default on Windows, so you may need to enable it first from Control Panel > Programs and Features > Turn Windows features on or off > Telnet Client.
  • Now, Open the Command Prompt.
  • Use the telnet command to check if a port is open: telnet <ComputerName> <PortNumber>
  • First, you will see a message saying ‘Connecting To <ComputerName>’

If the port is open, you’ll see a connection-established message.

If the port is not open, you will see a connection failed message.

In conclusion, these methods allow you to verify if a specific port is open and accepting connections on a Windows machine.

 

Messenger
Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.