windows check com ports in use code example
Example 1: powershell see ports in use
See Ports in Use:
Get-NetTCPConnection | where Localport -eq PORT_NUMBER | select Localport,OwningProcess
Kill Port In Use
*Set this command*
netstat -ano | findstr :PORT_NUMBER
*To find a ID Process look a exemple below*
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING THIS IS ID PROCESS --->[12948]
*Kill IDProcess*
taskkill /PID IDPROCESS /F
Example 2: common ports
#Common Ports
20 – FTP (File Transfer Protocol) Data Transfer
21 – FTP (File Transfer Protocol) Command Control
22 - SFTP (SSH File Transfer Protocol)
22 – SSH (Secure Shell)
23 - Telnet - Remote login service, unencrypted text messages
25 – SMTP (Simple Mail Transfer Protocol) E-mail Routing, Sending email
53 – DNS (domain name service)
80 – HTTP (Hypertext Transfer Protocol) used in World Wide Web. "web server"
110 – POP3 (Post Office Protocol) used by e-mail clients to retrieve e-mail from a server
119 - NNTP (Network News Transfer Protocol)
123 – NTP (Network Time Protocol)
143 – IMAP (Internet Message Access Protocol) Management of Digital Mail)
163 - SNMP (Simple Network Management Protocol)
194 - IRC (Internet Relay Chat)
443 – HTTPS (HTTP Secure (HTTPS) HTTP over TLS/SSL). "secure web server"
465 – SMTPS (send secure email)
631 – CUPS (print server)
993 – IMAPS (secure email inbox)
995 – POP3 (secure email inbox)