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
I wrote something similar. This works (you can remove the pause):
Results in txt file:
etc.