Batch. ping scanner

Written by Leif Stenfeldt. Posted in Dos, Programmering, Tips

@ECHO OFF
SET output=%USERPROFILE%\output.txt
IF EXIST “%output%” DEL “%output%”
FOR /L %%G IN (1, 1, 69) DO (
CALL :ping 192.168.%%G.3
CALL :ping 192.168.%%G.4
)
GOTO :EOF

:ping
ping -n 1 %1 >NUL && ECHO %1>>”%output%”


 

source: http://stackoverflow.com/questions/5037382/batch-file-loop-ping-output-to-file-hosts-that-are-up

 

1474 views

Leave a comment