复制代码
- @echo off&setlocal enabledelayedexpansion
- set n=1
- set m=0
- for /f "delims=" %%a in ('dir /b *.txt') do (
- set /a m=!m!+1
- ren "%%a" "!n!.!m!.txt"
- if "!m!" == "2" set /a n=!n!+1&&set m=0
- )
- pause
欢迎光临 批处理之家 (http://www.bathome.net/) | Powered by Discuz! 7.2 |