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

[Powershell]: Get system information with systeminfo command

Get system information with systeminfo command 1. Create get-systeminfo.ps1 file Use notepad or any text editor to create get-systeminfo.ps1 # Description: powershell script to get computer's system information # get computer name $computername = gc env:computername # get year month date hour minute $today = (get-date).ToString("yyyyMMddHHMM") # get computer's system information systeminfo >> $computername-$today.txt # end of script 2. Create scheduled task to run get-systeminfo.ps1

MSSQL: Fix error 'Consistency validation for SQL Server registry keys'

While installing Microsof SQL Server 2012, I ran into the following error. "The SQL Server registry keys from a prior installation cannot be modified. To continue, see SQL Server Setup documentation about how to fix registry keys." How to fix Replace the D:\x64\FixSqlRegistryKey_x86.exe file with the original file from the ENU\SQLFULL_ENU.iso file downloading from Microsoft Download Center. This ISO file is 4.2GB. So you can click FixSqlRegistryKey_x86.exe to download this file only. After replacing that file, press Re-run to check. All rules are passed.

Bitnami: Notes

"Bitnami makes it easy to get your favorite open source software up and running on any platform, including your laptop, Kubernetes and all the major clouds."