Table of Contents

Dos

for /l %i in (0, 1, 255) do ping -w 1 -n 1 192.168.0.%i
for /l %i in (0, 1, 255) do ping -w 1 -n 1 192.168.0.%i >> ping.log
for /l %i in (0, 1, 255) do ping -w 1 -n 1 192.168.0.%i && arp -a 192.168.0.%i
for /l %i in (0, 1, 255) do ping -w 1 -n 1 192.168.0.%i && arp -a 192.168.0.%i >> search.log
findstr dynamic search.log

Ping Test

@echo off
@setlocal EnableDelayedExpansion

ping -n 1 192.168.0.1 | find "TTL" > nul 2>&1
if %ERRORLEVEL% equ 0 (
  echo 192.168.0.1 OK
) else (
  echo 192.168.0.1 NG
)

echo.
echo Done.

pause > nul

Another User

runas /user:foo