title: Problems while comparing years and sizes of file in batch
body: <p>I've a doubt for doing a comparison (if statement's) inside a for loop:
  I've a lot of files inside a folder, and I want to make two comparisons:</p>
  <ol>
  <li>If the file was created at the current year (!dateFile:~6,4! equ %date:~6,4%)</li>
  <li>If the size of the file is 0 bytes (%%~Za equ 0)</li>
  </ol>
  <p>When I find a file that complies these conditions, I want to show &quot;ok&quot;.</p>
  <p>I've the next line of code, but it doesn't work:</p>
  <pre><code>    for /f &quot;tokens=* delims= &quot; %%a in ('dir /s/b/a-d &quot;FOLDER\&quot;') do set dateFile=%%~ta if ((!dateFile:~6,4! equ %date:~6,4%) &amp; (%%~Za equ 0)) echo &quot;ok&quot;
  </code></pre>
  <p>Some help? Thanks :)</p>