it:windows:range-ping
IP Range PING
Um die Verfügbarkeit (via ping) in einer Range sicherzustellen, kann einfacher einzeiliger script verwendet werden
PowerShell:
1..100 | %{ping -n 1 -w 15 192.168.1.$_ | select-string "Antwort"}
cmd - Command Box:
evtl. -w 100 - Wartezeit zw. pings verkleinern/vergrößern.
for /L %x in (1,1,255) do ping -n 1 192.168.1.%x | find /I "Antwort" >> c:\temp\pingresult.txt
oder
for /l %i in (1,1,254) do @ping 192.168.1.%i -n 1 -w 100 | find "Antwort"
In deutschen Betriebssystemen Suchwort: Antwort
In englischen Betriebssystemen Suchwort: Reply
Multi-ping mit farblicher Ausgabe
@echo off Rem Multiping script mode con cols=60 lines=20 Title Multi-colors - Multi-Ping set "URLS=C:\URLliste.txt" set "LogFile=PingResultat.txt" If exist %LogFile% Del %LogFile% call :init echo( call :color 0E "------- Ping Status of Computers hosts -------" 1 echo( ( echo ****************************************************** echo PingTest executed on %Date% @ Time %Time% echo ****************************************************** echo( ) > %LogFile% Setlocal EnableDelayedExpansion for /f "usebackq delims=" %%a in ("%URLS%") do ( for /f "tokens=2 delims=[]" %%b in ('ping -n 1 %%a') do set "ip=%%b" ping -n 1 %%a>nul && set "msg=%%a - !ip! ALive ok" && Call :Color 0A "!msg!" 1 || set "msg=%%a - !ip! Dead failed to respond" && Call :Color 0C "!msg!" 1 echo !msg! >> %LogFile% ) ) EndLocal Start "" %LogFile% pause>nul & exit :init prompt $g for /F "delims=." %%a in ('"prompt $H. & for %%b in (1) do rem"') do set "BS=%%a" exit /b :color set nL=%3 if not defined nL echo requires third argument & pause > nul & goto :eof if %3 == 0 ( <nul set /p ".=%bs%">%2 & findstr /v /a:%1 /r "^$" %2 nul & del %2 2>&1 & goto :eof ) else if %3 == 1 ( echo %bs%>%2 & findstr /v /a:%1 /r "^$" %2 nul & del %2 2>&1 & goto :eof ) exit /b
~~UP~~
it/windows/range-ping.txt · Zuletzt geändert: 2019/11/20 17:35 von max