Windows 8.1 Ping A batch file with an IP address

Source: Internet
Author: User

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.
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.