No matter LAN or LAN, you may want to know which IP is useful and which IP is useless. This is not written for LAN all, but you can also take it when scanning LAN IP situation. Looking up some information on the internet, it looks very complicated. When you need to ping a large number of IP address, it is cmd to open the ping command, after the completion of a ping and then modify the suffix value, and then execute. It's going to be a lot of effort, OK, no more.
The code is as follows |
Copy Code |
@echo off Echo. echo —————-Please enter the IP address front paragraph. For example: 192.168.1 ——————- set/p a=: Echo. echo--– Please enter the IP address [start] after paragraph. For example: 1 (enter a number between 1-255) Echo. set/p b=: Echo. echo--Please enter the IP address [end] after paragraph. For example: 255 (enter a number between 1-255) Echo. set/p c=: :p ping-n 1%a%.%b% set/a b+=1 If%b% lss%c% goto P Echo. Echo. Echo. Pause |
The above characters are very convenient, very concise ah. You need to use it again. Where you want to output the results to disk as a file save you can modify the red field above:
The code is as follows |
Copy Code |
Ping-n 1%a%.%b%>d:ping. Txt |
The above means that the results are output to the D-packing directory in the PING.txt file, if it does not exist the new file, the existence of the contents of the cover.