I've created a batch script to read IP addresses or hostnames from a file, and feed them to nslookup, however when I run the script, it says that the system did not find the file.
What am I doing wrong?
Here's the code:
@echo off
setlocal enableextensions enabledelayedexpansion
if exist hostnames.txt del hostnames.txt
for /F %%A in (%1) do nslookup %%A >> hostnames.txt
Thanks in advance
REM @echo off
del nslookup.txt 2>nul
pause
for /f "delims=" %%a in (c:\tools\server.txt) do NSLOOKUP %%a >> c:\tools\nslookup.txt
Name: server1.XXXX.com
Address: xxx.XX.XXX.XXX
Server: server2.XXXX.com
Address: xxx.XX.XXX.XX
etc.