192.168.1.1,My Webpage
216.239.59.99,Google
10.0.0.12,Network Printer
I would like to ping the IPs, and print a message depending on whether the
IP responds or not, eg
c:\>go.bat
My Webpage is up
Google is up
Network Printer is down
Is this possible, and is there an easier way of doing this than a batch
file?
Thanks in advance,
Tim
Try this one:
@echo off
for /f "delims=, tokens=1*" %%a in ('type a.txt') do (
ping %%a|find "TTL">nul
if not errorlevel 1 (echo %%b : UP) else (
echo %%b : Down))
Brilliant, it worked first time!
Thanks,
Tim
For example I would like the ping to appear by servers in different area or
sites.
Thanks
"Tim Baker" <tim.bak...@NOSPAMsomersetcare.co.uk> wrote in message
news:10cdrpc...@corp.supernews.com...
A quick & dirty solution would be to put a line containing "127.0.0.1," as a
separator in your text file. This would result in a line simply containing
": UP".
eg:
---a.txt---
10.0.1.1,Remote Site 1
10.0.2.1,Remote Site 2
127.0.0.1,
10.0.0.23,Printer 1
10.0.0.24,Printer 2
--Result--
Remote Site 1 : UP
Remote Site 2 : UP
: UP
Printer 1 : UP
Printer 2 : UP
How about adding a bit of colour, green for up and red (flashing if
possible) for down
Thanks
"Tim Baker" <tim.bak...@NOSPAMsomersetcare.co.uk> wrote in message
news:10ciqgb...@corp.supernews.com...