@echo off
setlocal enabledelayedexpansion
for /f "tokens=3" %%a in ('fsutil volume diskfree d:\') do (
for /f "delims=" %%b in ("%%a") do set "free=%%b"
if "!free:~10,1!"=="" (echo 硬盘空间不足) else (
if "!free:~12,1!"=="" ( cd . ) else (
if "!free!" lss "10737418240" echo 硬盘空间不足
)
)
goto :end
)
:end
pause