1
Im writing a script to ping WAPs and Switches within a school and everything on it is running great aside from it will not pipe no responses into a .txt because I have added
| FIND "TTL="
This is basically my script aside from mutlitple lines for all the IP's
@echo off
del Test.txt
set /p var1=How many times would you like to test the connection for each device?
cls
echo Testing WAP Connections, Please Wait...
ping -n %var1% 127.0.0.1 | FIND "TTL=" > Test.txt
when I run the script with the "FIND" part of the script i get this output
Reply from 127.0.0.1: bytes=32 time<1ms TTL=255
but if i dont get a reply from whatever i am pinging, it wont make a record of it in the .txt file. Is there any way I can get it to record a failed ping without having to get rid of: " | FIND "TTL=""?
The line,
del Test.txt
is not needed. The > in the ping line will overwrite the file at a better time (that will let your users press ctrl+C during the input and leave the old test data). – krowe – 2014-08-11T07:57:45.797