本帖最后由 qixiaobin0715 于 2021-10-13 23:33 编辑
- @echo off
- set Letters=1abcdefghijklmnopqrstuvwxyz
- setlocal enabledelayedexpansion
- for /l %%a in (1,1,26) do set #%%a=!Letters:~%%a,1!
- for /d %%i in (*) do (
- set m=0
- set n=5
- for /f "delims=" %%j in ('dir /b /a-d /o-n "%%i\*.*"') do (
- set str=%%~nj
- set str=!str:~1!
- if "!str!" geq "08" (
- set /a m+=1
- for %%x in (#!m!) do ren "%%j" "!str!a!%%x!%%~xj"
- ) else if "!str!" leq "04" (
- set /a n-=1
- for %%y in (#!n!) do ren "%%j" "!str!!%%y!%%~xj"
- )
- )
- )
- pause
复制代码
|