Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 385 Posts 156 Joined 2007-01-19 02:32 19-year member UID 76955 Gender Male
Status Offline
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
for %%a in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
if exist %%a:\nul (
for /f "tokens=3" %%b in ('dir /-c %%a:\^|find "可用字节"') do set freesize=%%b
set /a freesize=!freesize:~0,-3!/1049>nul
if !freesize! GTR ^18000 (md %%a:\Temp & goto exit)
)
echo %%a has less than 18G, continue checking the next disk
pause
)
:exit
echo Task completed, press any key to exit
pause
exit
I don't know whether there are any problems with the code. Please check whether it's rigorous enough.