@echo off
echo.>dd.txt
SETLOCAL ENABLEDELAYEDEXPANSION
for %%a in (c d f) do (
for /f "tokens=3" %%b in ('dir /-c %%a:\^|find "可用字节"') do set freesize=%%b
set /a freesize=!freesize:~0,-3!/1049>nul
if !freesize! LEQ ^5000 (echo %%a盘空间不足5G>>dd.txt)
)
::下面你自己写吧,把dd.txt传到客户端以及怎么在客户端提示
[ Last edited by andred0421 on 2007-11-22 at 10:30 AM ]
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
for %%a in (c d e f g h) do (
if exist %%a:\ (
for /f "tokens=3" %%b in ('dir /-c %%a:\^|find "可用字节"') do set freesize=%%b
set /a freesize=!freesize:~0,-3!/1049>nul
if !freesize! LEQ ^5000 (net send it2 "请注意:%%a盘空间不足5G!")
)
)
哈哈,稍微修改了一下,终于可以了!