- @echo off
- cd /d "%~dp0"
- set n=0
- for /d %%d in (*) do (
- set /a n+=1
- )
- for %%a in (1 10 100 1000 10000 100000 1000000) do (
- if %n% geq %%a (
- set /a m=%%a*10
- )
- )
- for /f "delims=" %%d in ('dir /b /ad') do (
- set str=%%d
- set /a m+=1
- setlocal enabledelayedexpansion
- ren "!str!" "!m:~1!_!str!"
- endlocal
- )
- pause
复制代码
|