code of batch file : rem check free space of the drive freedisk.exe D: 20GB (the freedisk.exe only use minimum bytes). rem space of the drive D not enough IF errorelevel 1 goto :error rem space of the drive D enough 7z.exe C:\myapplication.7z -aoa -o"D:\" :error echo Your drive's space not enough, plz trying again!!! But the freedisk.exe is wrong, it's return wrong value. And i'm trying other way. (chkdsk, dir, fsutil,...) Do you resolve that?