Friday, May 20, 2011

Useful Update for the Previous Blog Post

After publishing the previous blog post, we have received a message with the script that lets one avoid printing all the details of pinging many IP addresses and saying which of them are available instead. It is really a handy and useful script and we decided to share it with the readers of our blog.
@echo off
for /l %%i in (1,1,255) do (
ping -n 1 192.168.1.%%i | findstr "TTL=" 1>nul && (
echo 192.168.1.%%i is UP
) || (
echo 192.168.1.%%i is DOWN
)
)

2 comments:

  1. very similar to mine, but you can choose any ip address, and it's one line :)

    @echo off & For /L %%i in (%4,1,255) do @ping -n 1 %1.%2.%3.%%i | find "Received = 0" >nul & if errorlevel 1 @echo %1.%2.%3.%%i

    ReplyDelete
  2. Thank you for your suggestion, it's really simple and useful script.

    ReplyDelete

Translate