title: Windows batch file to find files in a folder for error checking
body: <p>This part of my script is supposed to go through directories looking for *.wim files and if it finds them on the "images" folder, proceed. However, it is going straight to the "else" part of the code :/ </p>
  
  <pre><code>ECHO. Checking for WIMs
  ECHO ............................................
  ECHO. 
  
  for /F "tokens=*" %%f in ('dir /B /S "%w%:\data\images"') do (
      if exist "%%~ff\*.wim" ( 
      ECHO found me some wims! let's continue.     
      GOTO actionmenu
      ) else (
           ECHO This script requires a wim repository folder to proceed. make sure you have
           ECHO properly populated the "\Images" folder before re-running this script
      goto end
      )
  )
  </code></pre>