@echo off
for /f %%h in (hostlist) do call :back %%h
ping /n 5 127.1>nul 2>&1
:back
set temp=%1
for /f "skip=1 delims=[] tokens=2" %%i in ('ping /n 1 %1') do call :set %%i
echo %1=%temp%
goto :eof
:set
if "%1"=="" goto :back
set temp=%1
goto :eof
@echo off
for /f %%h in (hostlist.txt) do call :back %%h
::ping /n 5 127.1>nul 2>&1
:back
set temp=%1
for /f "skip=1 delims=[] tokens=2" %%i in ('ping /n 1 /i 1 %1') do call :set %%i
echo %1 %temp%
goto :eof
:set
if "%1"=="" goto :back
set temp=%1
goto :eof