CODE: [Copy to clipboard]
for /f "tokens=3" %%c in ('dir /a:-d/s/-c/w d:\^|find "个文件"') do (
set allfilesize=%%c
)
if "%allfilesize%" == "" goto notgetfilesize
goto shownumber
:notgetfilesize
for /f "tokens=3" %%c in ('dir /a:-d/s/-c/w d:\^|find "File(s)"') do (
set allfilesize=%%c
)
if "%allfilesize%" == "" goto notgetfilesize1
goto shownumber
:notgetfilesize1
goto end
::for /f "tokens=3" "delims=" %%i in ('dir /a:-d /s /-c /w D:\backupsys^|find "File(s)"') do set /a allfilesize+=%%i
::/1048576
:shownumber
@echo FILE SIZE: %allfilesize%
@echo DISK SIZE: %diskfreesize%
if %allfilesize% geq %diskfreesize% echo There was no rich space to backup !
if %allfilesize% lss %diskfreesize% echo The backup is start