Hi,
I saw that there was a thread created to assist in creating a script that would generate a file showing if a computer has a ping response, I need some advice on how to now not only show that status but to keep the IP address that is associated with that computer.
This was created by quux :-
This script shows:-
ComputerName Ping fine
or
ComputerName NO PING REPLY
I would like to see:
ComputerName - IP Address Ping fine
or
ComputerName - <Blank> NO PING REPLY
Does anyone know how to add this into the script?
I saw that there was a thread created to assist in creating a script that would generate a file showing if a computer has a ping response, I need some advice on how to now not only show that status but to keep the IP address that is associated with that computer.
This was created by quux :-
Code:
@echo off
for /f %%a in (computers.txt) do call :DOIT %%a
echo.
echo DONE!
goto :eof
:DOIT
set pingreply=
for /f "tokens=1" %%a in ('"ping -n 1 |findstr "Reply""') do set pingreply=%%a
if not defined pingreply (echo %1 NO PING REPLY >> tracker.txt) & goto :eof
echo %1 Ping fine >> tracker.txt
goto :eof
This script shows:-
ComputerName Ping fine
or
ComputerName NO PING REPLY
I would like to see:
ComputerName - IP Address Ping fine
or
ComputerName - <Blank> NO PING REPLY
Does anyone know how to add this into the script?