::Search for empty dirs.
::by lvfeng, Mar 11,2009
::Search for empty dirs.
::by lvfeng, Mar 11,2009
@echo off
setlocal enabledelayedexpansion
color 1E
echo 本程序搜索空目录
echo.
echo by www.lfhacks.com
echo.
echo 按任意键开始…
pause >NUL
dir /AD /ON /B >tempp
if exist result.txt del result.txt
echo.
echo 搜索到的空目录有:
for /f “tokens=*” %%i in (tempp) do (
dir “%%i”|find ” 0 File(s)” > NUL
set nofile=!errorlevel!
dir “%%i”| find ” 2 Dir(s)” > NUL
if !errorlevel!==0 if !nofile!==0 (echo %%i
echo %%i >> result.txt
)
)
del tempp
echo.
echo 搜索结果已导出到result.txt
echo.
echo www.lfhacks.com
pause >NUL
exit
© 版权声明
文章版权归作者所有,未经允许请勿转载。