- @echo off
- Setlocal Enabledelayedexpansion
- set totle=0
-
- call :shuchu "" 本目录下
-
- for /f "skip=2 tokens=4" %%a in ('dir *^|find "DIR"') do (
- call :shuchu %%a\ %%a子文件夹中
- )
-
- echo %~d0%~p0中总共有文本文件%totle%个>>list
- ren list list.txt
- set n=,m=,totle=
- del %0
- exit
-
- :shuchu
- for /f %%a in ('dir /d %1*.txt^|find "个文件"') do (
- set /a totle=%totle%+%%a
- echo %2有文本文件%%a个:>>list
- )
-
- set "kong= "&set n=0
- for /f %%a in ('dir /b %1*.txt') do (
- set /a n+=1&set "str=%%a%kong%"
- set /p =!str:~,10! <nul>>list
- set /a quyu=!n!%%5
- if !quyu! equ 0 echo.>>list
- )
- echo.>>list
- echo.>>list
复制代码
[ 本帖最后由 shqf 于 2008-9-4 22:19 编辑 ] |