title: Comparison of strings using variables always false (in Batch)
body: <p>In my current folder, I have a file named <code>backup(yyyy-mm-dd).7z</code><br/>
  I need to keep that <code>length</code> variable even though here it is a constant.</p>
  
  <pre><code>@echo off
  setlocal EnableDelayedExpansion
  
  set "a=.\backup"
  set "b=yyyy-mm-dd"
  set "length=19"
  
  for %%f in (.\*) do (
  
      set "fullpath=%%f"
      set "trimpath=!fullpath:~0,%length%!"
  
      set trimpath
      echo trimpath=%trimpath%
  
      if %trimpath% == %a%(%b% echo this is equal
  )
  </code></pre>
  
  <p>I have 2 questions regarding that code:<br/></p>
  
  <ol>
  <li>Why can I see the value of trimpath when I call <code>set trimpath</code> but not directly with <code>%trimpath%</code>?</li>
  <li>Why is my condition false? What should I do to get it true?</li>
  </ol>