Copy the following code into Notepad, and then change the suffix to bat to click Run to see all port usage
COLOR 0ACLS@ECHO OffOnline Computer ip:send in the Title query LAN@ECHO off&setlocal Enabledelayedexpansionecho is getting the IP address of this machine, please wait a moment ... for /F "tokens=3Skip=2Delims=: "%%Iinch('Nbtstat-n') Do (SetThe IP=%%i "SetIp=! Ip:~1,-1! The ECHO native IP is:! Ip! Goto:Next ):Next for /F "delims=. Tokens=1,2,3,4"%%Iinch("%Ip%") doSetRange=%%I.%%J.%%k ECHO.&ECHO is getting other online computer names in this network section, please wait a moment ... ECHO This network segment "%Range%.*"The computers Inside are: for /F "delims="%%Iinch('net view') Do (Set"var=%%i ":: Query online computer nameif"!var:~0,2!"=="\\" ( Set"var=!var:~2!" ECHO!var! Ping-N1!var!>nul)) ECHO. ECHO is acquiring other online computer IPs in this network segment, please wait a moment ... for /F "Skip=3Tokens=1,*Delims="%%Iinch('arp-a') Do ECHO IP:%%I am using Echo.echo query finished, press any key to exit ... pause>Nul
View the port occupancy script in LAN under Windows