title: How to divide possibly big numbers in Batch?
body: <p>My question concerns a script I'm writing to automatically back up several Folders and subfolders with a batch file.<br>
  Now I'm trying to implement some kind of progress indicator in a readable format, preferably in per cent.<br>
  First of all, it reads the total size to copy with the following command:</p>
  
  <pre><code>FOR /R "C:\Users\XXX" %%F IN (*.*) DO (
  set /a overall=!overall!+%%~zF
  )
  </code></pre>
  
  <p>For the specific folder in my testing batch, this returns a size of 266,173,879 Bytes.<br>
  However, if I try to divide this number by, say, 1024 (for Kilobytes) after the for-loop with</p>
  
  <pre><code>set /a overall=%overall%/1024
  </code></pre>
  
  <p>the Batch returns something along the lines of "/1024 can not be used here syntactically" (You probably know the correct translation, mine is in German).<br>
  I tried adding/removing parantheses and spaces, but I keep getting the same error.  </p>
  
  <p>Is there something wrong with my syntax, which I'm too blindfolded to see?<br>
  If not, how do you call a C++ .exe delivering the value of %overall% to be assigned to a C++ variable?
  (C++ is the only other programming language I have minimal to basic knowledge of, PowerShell is not an option, it has to be regular Windows Batch)</p>
  
  <p>complete code of relevance:</p>
  
  <pre><code>FOR /R "C:\Users\XXX" %%F IN (*.*) DO (
  set /a overall=!overall!+%%~zF
  )
  
  set /a overall=%overall%/1024
  
  FOR /R "C:\Users\XXX" %%F IN (*.*) DO (
  xcopy "%%F" "E:%%~pF" %parameter%&gt;nul
  cls
  echo Copying... Progress: !size! of !overall! KB copied.
  )
  </code></pre>