- @echo off&setlocal ENABLEDELAYEDEXPANSION
- set num=1
- set 文件夹a=C:\a\
- for /f "delims=" %%a in ('dir /s /b /ad "%文件夹a%" 2^>nul') do (
- set "source="
- cd /d %%a
- for /f "delims=" %%b in ('dir /b *.txt 2^>nul') do (
- set "source=!source!+%%b"
- )
- set source=!source:~1!
- copy !source! "%文件夹a%!num!.txt"
- cd
- set/anum+=1
- )
复制代码
|