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 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


RSS Icon Subscribe to comments

You need to login to post a comment.