In Windows XP, you can easily obtain batch files with unused IP addresses.

Source: Internet
Author: User

When we solve a DHCP fault in a Windows operating system, we sometimes need to find out which addresses within a certain address range are not used. You only need to create a batch file and require it to only return unused IP addresses, and then input the command result to a text file.

As a network manager, when we solve DHCP faults in windows, we sometimes need to find out which addresses within a certain address range are not used. I have previously introduced a method: Open the Command Prompt window, in... In... Call the ping command in the do loop. For example, to find out which addresses are not used from 192.168.1.1 to 192.168.1.100, run the command: For/L % F in (100,) Do ping.exe-N 2 192.168.1.% F

This command reports all IP addresses in the specified range. Users have to read a large amount of content in the command line window, whether in use or not. In fact, we can completely avoid these troubles. We only need to create a batch file and require it to only return unused IP addresses, and then input the command results into a text file. The following describes how:

Open notepad and enter the following command in the window:

CopyCode The Code is as follows: @ echo off

Date/T> iplist.txt

Time/T> iplist.txt

Echo ============>> iplist.txt

For/L % F in (1,1, 100) Do ping.exe-N 2 192.168.1.% F | find

"Request timed out." & Echo 192.168.1.% F timed out>

Iplist.txt & echo off

CLS

Echo finished!

@ Echo on

Notepad.exe iplist.txt

Save this file as iptracker. BAT and close notepad.Program.

Note that in this batch file, the entire... In... The do command is composed of several commands connected. This command starts with "for" and ends with "off", and the entire command must be on one line. Of course, if you want to use this method, you need to replace the IP address in the example with your own IP address.

In the future, if you want to solve the DHCP problem, you can locate and double-click iptracker in the browser window. BAT file, and then start an IP address tracking tool, this batch process only find those unused IP addresses, and save the results to the notepad file. (In this example, the stored batch file becomes an IP address tracking tool, which can be created once and used repeatedly .)

Note: This method is only applicable to Windows XP Professional (Professional Edition)

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.