title: Reading a text file from a batch file, then passing text to another function
body: <p>Hope someone can help. I've tried by googling this site but I'm either getting the wrong keywords or else I'm the first person to come across this issue (unlikely).</p>
  
  <p>I'm trying to read a list of domains from a text file in a Windows batch file, which I'll post below. For each of those I'm trying to write the results to a file. I've looked at various uses of the "for /f" but can't fathom out what I need to do to get the line to work. Here's the code:</p>
  
  <pre><code>@setlocal
  @echo off
  for /F  "tokens=1" %%D in (c:\whois-for-win32\domainlist.txt) do call :reportit
  endlocal
  goto :eof
  
  :reportit
  setlocal
  echo " Retrieving details for:  %%D"
  echo " WHOIS:       %%D" &gt;&gt; c:\whois-for-win32\results\domainlisting.txt
  echo "=============================================================" &gt;&gt; c:\whois-for-win32\results\domainlisting.txt
  whois %%D &gt;&gt; c:\whois-for-win32\results\domainlisting.txt
  timeout 8
  endlocal
  </code></pre>
  
  <p>Now, assume the data file referred to has only one domain listed per line. Obviously the reason I'm doing this is that we've got a rather large number of domains to check.</p>
  
  <p>Your thoughts and ideas all gratefully received!</p>