title: free disk space via cmd batch file to txt
body: <p>ive used this and it works on normal volumes like C:
  but it doesnt work on a SD card. E: in this case</p>
  
  <pre><code>@echo off &amp; setlocal ENABLEDELAYEDEXPANSION
  SET "volume=e:"
  FOR /f "tokens=1*delims=:" %%i IN ('fsutil volume diskfree %volume%') DO (
      SET "diskfree=!disktotal!"
      SET "disktotal=!diskavail!"
      SET "diskavail=%%j"
  )
  SET /a diskused=%disktotal:~0,-9% - %diskavail:~0,-9%
  ECHO(%date% %TIME: =0% &gt;&gt; space.txt
  ECHO(Information for volume %volume%  &gt;&gt; space.txt
  ECHO(TOTAL SIZE  ---------- %disktotal:~0,-9% GB &gt;&gt; space.txt
  ECHO(USED SIZE ------------ %diskused% GB &gt;&gt; space.txt
  ECHO(AVAILABLE SIZE ------- %diskavail:~0,-9% GB &gt;&gt; space.txt
  </code></pre>
  
  <p>i get this:</p>
  
  <pre><code>30-11-2019 03:33:42.04 
  Information for volume e:  
  TOTAL SIZE  ---------- ~0,-9 GB 
  USED SIZE ------------ -1 GB 
  AVAILABLE SIZE ------- ~0,-9 GB 
  </code></pre>
  
  <p>why?</p>
  
  <p><strong>dir e:\|find /i "bytes free" >> space.txt</strong> gets the available space correctly but not in the format i want</p>