ping_summary.bat Download

Usage: C:\File\Location> ping_summary.bat, Edit the IP_ADDRESS variable for IP-address to ping.

@ECHO off
set D_MATCH=bytes=32
set PINGCOUNT=1
set IP_ADDRESS=(www.google.se www.facebook.com www.yahoo.com 8.0.0.1 8.8.8.8)
set IPADDR=asd

ECHO STATUS	:	IP

for %%t in %IP_ADDRESS% do (
for /f "tokens=1,2,3,4,5,6,10" %%i in ('ping -4 -n %PINGCOUNT% %%t') do (
if "%%l"=="%D_MATCH%" (
set IPADDR=%%k
set UPDOWN=Up
) ELSE (

if "%%o"=="%PINGCOUNT%" (
set IPADDR=%%t:
set UPDOWN=Down
)
)

)
call :print
)

goto :end

:print
echo %UPDOWN%	:	%IPADDR%

:end
ping_sweep.bat Download

Usage: C:\File\Location> ping_sweep.bat, output will be saved in the same folder where the script is run

@ECHO OFF

    SET IP_ADDRESS=(172.16.80.2 172.16.10.254 172.16.50.1 172.16.100.1 172.16.100.252 172.16.100.253 172.16.2.2 172.30.1.1 172.16.2.14 172.16.80.1 172.16.50.1 172.16.100.1 172.16.100.252 172.16.100.253 172.16.2.2 172.30.1.1 172.16.2.14)
    SET FILENAME=ping_sweep.txt


    SET LOG_DIR=%~dp0
    SET COUNTER=1
    ECHO Addresses to ping: %IP_ADDRESS%
    ECHO Log file will be placed in %LOG_DIR% named %FILENAME%

    @ECHO ----------%time%------------ >> %FILENAME%
    @ECHO Ping of %IP_ADDRESS% >> %FILENAME%
    ECHO Running pings, this might take a while.
    FOR %%i IN %IP_ADDRESS% DO (
    ECHO Pinging %%i
    PING -4 %%i >> %FILENAME%
    )

    ECHO Done, opening output saved in %LOG_DIR%%FILENAME%
    START %LOG_DIR%%FILENAME%
    PAUSE