@echo off
for %%a in (*.txt) do (
echo %%~na|findstr "^[0-9]*$" >nul && (
if %%~na lss 10 (
ren "%%~a" "abc00%%~na.tmp"
) else (
if %%~na lss 100 (
ren "%%~a" "abc0%%~na.tmp"
) else (
ren "%%~a" "abc%%~na.tmp"
)
)
)
)
ren abc*.tmp abc*.txt
pause
建个批处理文件文件,内容如下 copy a.txt 123\b.txt copy a.txt 123\c.txt