|
@echo off
for /f "delims=" %%a in ('dir /s /b /ad D:\*') do call :slz "%%a"
echo explorer.exe "%folder%"
pause
:slz
set xxx=%~1
if not defined xxx goto:eof
if not defined folder set "folder=%~1"
for /f "tokens=1* delims= " %%i in ('dir /-c "%~1"^|find "个文件"') do set most=%%i
if not defined most1 set most1=%most%
if "%most%" gtr "%most1%" set "most1=%most%" & set "folder=%~1"
echo "%~1" 有%most%个文件!
goto:eof
这个是以文件夹内文件的数量为条件的,这里的路径是D:\,少了Documents and Settings,给老大们看看,有什么问题没有? |
|