Continuing from post https://computing.net/answers/pr…
———————————————————–
I need to try and modify the script below to tell me if the machine was pingable or not. This script doesn’t work well if the machine’s IP address was cached in the DNS server.
@echo off
set ComputerList=list.txt
Echo Computername,IP Address>Final.csv
setlocal enabledelayedexpansion
for /f “usebackq tokens=*” %%A in (“%ComputerList%”) do (
for /f “tokens=3” %%B in (‘ping -n 1 -l 1 %%A ^|findstr Reply’) do (
set IPadd=%%B
echo %%A,!IPadd:~0,-1!>>final.csv
))
And the script I provided you above does not work? If so what is the error you are getting?
Are you still having DNS issues with the script? If so did you try Response Number 4 to refresh the cache?
“was that is got the information from the DNS server with the last known IP address and didn’t accurately tell me that the machine wasn’t available”
Can you explain this? Do you want to get a list of IPs to ping from the DNS server? Is that the issue?
Simply define exactly what it is want the script to do.
“I work on government networks and can’t use programs like that.”
Also if you are working on a government system you should not be running scripts like this with out admin approval because they might be monitoring ICMP traffic.
If it is just a problem of installing then try the first App, I gave you. It is stand alone and does not need to be installed. It will run just by double clicking on it.