title: Batch script math incorrect
body: <p>I have the following code that gets the size of my Downloads folder then divides it and sets it to a variable.
  I have 7 other lines just like this that work, but this one doesnt.</p>
  <p>The %div2% is coming up blank.</p>
  <p>Does anyone see what I did wrong?</p>
  <pre><code>@echo off
  setlocal enableextensions disabledelayedexpansion
  
  set &quot;target2=C:\Users\%USERNAME%\Downloads&quot;
  if not defined target2 set &quot;target2=C:\Users\%USERNAME%\Downloads&quot;
  
  set &quot;size2=0&quot;
  for /f &quot;tokens=3,5&quot; %%a in ('
      dir /a /s /w /-c &quot;%target2%&quot;
      ^| findstr /b /l /c:&quot;  &quot;
  ') do if &quot;%%b&quot;==&quot;&quot; set &quot;size2=%%a&quot;  
  
  
  SET /A %size2%/1048576
  
  SET /A div2=%size2%/1048576
  
  echo  %DIV2%
  
  pause
  </code></pre>