Hi,
Below is somewhat im trying
@echo off
for /f %%i in (location of file\hostname.csv) do Call :StartPing %%i
goto :eof
:StartPing
PING %1 -n 1| FIND /i "TTL" > nul && goto Success
PING %1 -n 1| FIND /i "timed" > nul && goto Timedout
PING %1 -n 1 -w 400 | FIND /i "TTL" > nul || goto ErrorMsg
goto :EOF
:Success
for /F "tokens=3" %%a in ('ping %1 ^| find /i "TTL"') do set Address=%%a
for /F "tokens=2" %%a in ('ping -a %Address::=% ^| find /i "pinging"') do set HostName=%%a
set IPAddress=%Address::=%
echo %1, %IPAddress%,%Hostname%
for /f "tokens=2" %%a in ('nslookup %IPAddress% ^| find /i "Name: " ') do set "nsNAME=%%a"
echo "%nsname%"
echo %1, %IPAddress%,%Hostname% >> location of file Results.csv
goto :EOF
:Timedout
Echo %1, Request timed out.
Echo %1, Request timed out. >> location of file Results.csv
goto :EOF
:ErrorMsg
Echo %1, Ping request could not find host.
Echo %1, Ping request could not find host. >> Results.csv
goto :EOF
im stuck with nslookup export
delimiter -> Hostname;ip adress;nslookup hostname (output should have this result altogther)
hostname.csv -> are simply a list with hostname e.g computer 1
computer 2
Thanks for the big help.