Skip to main content

Ping group on Windows with FOR command

Source: https://www.foodbev.com/news/food-and-drink-firms-join-loop-waste-free-shopping-platform/

Notes from daily work situation.

One of my colleagues asked me to find out which IP address that his home router dynamically assign to his brand new TOTOLINK N9 Ceiling Mount Access Point without accessing to the home router.

Look at TCP/IP settings, I know the IP address range that the home router assign to client is 192.168.1.2 - 192.168.1.254.


I also know MAC address of the new TOTOLINK N9 Access Point.

So, the idea is using his laptop to ping IP addresses from 192.168.1.2 - 192.168.1.254, then using arp -a command to find out MAC Address of TOTOLINK N9 Access Point.

So, I use FOR command to ping a group of IP Addresses from 192.168.1.1 to 192.168.1.254

FOR /L %variable IN (start,step,end) DO command [command-parameters]

    The set is a sequence of numbers from start to end, by step amount.
    So (1,1,5) would generate the sequence 1 2 3 4 5 and (5,-1,1) would generate the sequence (5 4 3 2 1)


for /l %i in (1,1,254) do @ping 192.168.1.%i -n 1 -w 100 | find "Reply"

-n count       Number of echo requests to send
-w timeout     Timeout in milliseconds to wait for each reply


Ping and Arp command to find IP Address and MAC of TOTOLINK N9
Ping and Arp command to find IP Address and MAC of TOTOLINK N9

Popular posts from this blog

Microsoft Windows Server 2012 R2 Standard Evaluation Product Key

Microsoft Windows Server 2012 R2 Standard Evaluation D2N9P-3P6X9-2R39C-7RTCD-MDVJX DBGBW-NPF86-BJVTX-K3WKJ-MTB6V

ManageEngine ServiceDesk Plus - Reset password

Let's reset the default administrator's password to 'admin'

hmailserver: Notes from the field

hmailserver is one of free open source mail servers running on Microsoft Windows operating system.