title: FILE NOT FOUND when searching within text file
body: <p>I'm trying to write a batch file that will take a list of four-digit numbers from the file vlans.txt, search a given file <em>filename</em>, and if the string is found, append a line of text to file <em>newfile</em>.</p>
  
  <p>I'm still working on the find portion of it but for now I have an annoying error where it's telling me it doesn't find <em>filename</em>.  Any ideas?</p>
  
  <pre><code>    ::@echo off
      setlocal enabledelayedexpansion
  
      :input
      set /p filename=Please enter the filename of the config file, including extension: || set filename=error
      if "%filename%"=="error" goto input
  
      :newfile
      set /p newfile=Enter the name of the file you wish to create:
      copy /y nul "%newfile%" &gt;nul
  
      :parse
       FOR /F %%A IN (vlans.txt) DO (
       FIND /I "%%A" %filename%
       IF !ERRORLEVEL! EQU 0 (ECHO "delete VLAN %%A" &gt;&gt; "%newfile%")
       )
  
  
       set filename=
       set newfile=
       set v=
  </code></pre>