@echo off :top :: Loop through arp table entries and look for my device's MAC address set "ip=" echo Discovering network... :: clear arp cache echo. echo Clearing Arp cache... ::arp -d -a netsh interface ip delete arpcache :: Ping all IPs from 192.168.0.1 to 254 echo Ping IPs from 192.168.0.1 to 254... echo. for /L %%N in (1,1,254) do start /b ping -n 1 -w 200 192.168.0.%%N >nul timeout 1 >nul echo Filtering devices... echo. for /f "tokens=1" %%f in ('arp -a^|find "-50-c2-db"') do ( set ip=%%f echo Device found: %%f ) :: SmartWeb K Espressif Inc. MAC for /f "tokens=1" %%f in ('arp -a^|find "dc-4f-22-"') do ( set ip=%%f echo SmartWeb K: %%f ) echo Done pause