@echo OFF REM ******************************************************************** REM *** DiskFree.bat - Display how much disk space is available on a *** REM *** drive, and set the DISK_FREE environment *** REM *** variable to that amount. This batch file is *** REM *** very specific to COMMAND.COM under MSDOS *** REM *** version 5.0 and is not guaranteed to give *** REM *** correct results in any other circumstance. *** REM *** *** REM *** Here's another method for free disk space for drive C: *** REM *** CEnvi reg.dl=3;reg.ah=0x36;interrupt(0x21,reg); *** REM *** DISKFREE=reg.cx * reg.ax * reg.bx; *** REM ******************************************************************** if "%1" == "" GOTO SHOW_HOW if not "%2"=="" GOTO SHOW_HOW dir %1:\NUL | find "bytes free" | cenvi DISK_FREE = atol(gets()) / 1024 ECHO DRIVE %1 HAS %DISK_FREE% K-BYTES FREE GOTO FINI :SHOW_HOW ECHO DiskFree.bat - Show how much disk space is available on a drive, in kilobytes, ECHO and set DISK_FREE environment variable to that size ECHO USAGE: DiskFree DriveLetter ECHO Example: DiskFree C GOTO FINI :FINI