DOS Calculate Free Space on Drive


/ Published in: DOS Batch
Save to your folder(s)

Run this from within SQL Server to get free space on a drive into a table.

See http://snipplr.com/view/8339/write-disk-space-to-table/ for SQL.


Copy this code and paste it in your HTML
  1. @echo off >nullfile.txt
  2. set Drive=C:
  3. for /F "tokens=7" %%a in ('fsutil volume diskfree %Drive% ^| find /i "# of free"') do set free=%%a
  4. set free=%free:~0,-6%
  5. echo c: %free%

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.