Although you are getting 1GB free disk space, some part of your hard disk might be used by your system, Windows XP, or graphics card depending on your settings. However you can try the below batch code to get the available disk space:
Code:
@echo off
setLocal EnableDelayedExpansion
for /f "tokens=3 delims= " %%A in ('dir /s/-c \ ^|find "File(s)"') do (
set /a myFile=%%A/1000000
)
for /f "tokens=3 delims= " %%A in ('dir /s/-c ^|find "bytes free"') do (
set /a FREE=%%A/1000000
)
echo used: !myFile!MB
echo free: !FREE!MB
set /a TOTAL=!myFile!+!FREE!
echo total disk space: !TOTAL!MB
set /a pcUSED=(!myFile!*100)/!TOTAL!
echo percent used: !pcUSED!
Bookmarks