@echo off setlocal ENABLEDELAYEDEXPANSION if %1a==a ( echo Syntax: %0 ^ [seconds-between-pings] exit/b 1 ) if %2a==a ( set SLEEP=1 ) else ( set SLEEP=%2 ) echo %1| findstr "^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$" >nul if errorlevel 1 set TARGET=%1: :start for /f "tokens=2 delims=:" %%a in ('netsh wlan show interfaces ^| findstr /c:" SSID"') do set WIFI=%%a for /f "delims=/" %%a in ('ping -n 1 %1 -w 500 ^|more +2 ^| findstr "^[PRG][Iea]"') do set RESPONSE=%TARGET%%%a echo %WIFI:~1,32% - %TIME% - %RESPONSE:<=:% timeout /t %SLEEP% /nobreak >nul goto start