title: How to use increment value for SKIP in FOR loop of Batch script
body: <p>I want to use an incremented value for SKIP in FOR loop of batch script, below is code snippet which I tried but this not working. Please help if someone have any idea about this. This is requirement related to comparison between 2 files and logically I have to compare whether each from file1.txt contains in file2.txt or not. It is possible that file1.txt have 3 lines and file2.txt may have 30 lines. I had used code like below snippet:</p>
  <pre><code>@echo off
  setlocal enableextensions enabledelayedexpansion
  
  set /A result_count=1
  
  echo !result_count!
  echo %result_count%
  set &quot;result=&quot;
  
  for /F &quot;usebackq delims=&quot; %%x in (file2.txt) do (
  
    for /F &quot;skip=%result_count% delims=&quot; %%r in (file1.txt) do (
      if not defined result set &quot;result=%%r&quot;
    )
    
    if &quot;!result!&quot; == &quot;%%x&quot; (
          echo Passed
    ) else (
          echo Failed
    )
    
    set /A result_count+=1
  
  )
  </code></pre>
  <p><strong>Outputs:</strong></p>
  <ol>
  <li><code>!result_count!</code> have incremented value.</li>
  <li><code>%result_count%</code> did not have incremented value.</li>
  <li>Not able to use <code>!result_count!</code> as <code>skip=!result_count!</code> in for loop.</li>
  </ol>
  <p><strong>Expectation</strong></p>
  <ol>
  <li>Either I can use <code>!result_count!</code> as <code>skip=!result_count!</code> in for loop.</li>
  <li>Or <code>%result_count%</code> should have incremented value.</li>
  </ol>