View the port occupancy script in LAN under Windows

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.