Geraldo Netto schreef:
> for i in $( cat $1 ); do
>         nslookup  $i >> nslookup_log.txt
> done
> it catches the content of a file passed($1) and does nslookup for each
> entry of the file
> and i would like to know how to rewrite it for command, by now i have this:
> @echo off
> for %%p in ( entries separated by spaces ) do nslookup %%p >> nslookup_log.txt
> any idea on how to pass a file as argument?
@echo off
for %%x in ( %1 %2 %3 %4 %5 %6 %7 %8 %9 ) do nslookup %%x >> nslookup.txt

that allows 9 files so far (%1..%9)

if 9 isn't enough (note the commandline input limit of 127 chars or 
so..), make a subroutine in your batchfile and use some kind of dummy 
argument to jump to that part when the batchfile calls itself (or use 
goto commands).

@echo off
if "%1"=="" goto help
goto begin
if "%1"=="" goto end
nslookup %1 >> nslookup.txt
goto begin
echo Please input a computername, IP or file also like this: %0 [file] 
{file}. example: %0
goto end
> Thank you very much,
> Geraldo

This email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
Freedos-user mailing list

Reply via email to