- @echo off
- cd /d "%~dp0"
- for /d %%d in (*) do (
- pushd "%%d"
- setlocal enabledelayedexpansion
- for /f "tokens=1-2* delims=-" %%i in ('dir /b /ad') do (
- set "c=%%k|"
- for /f "tokens=* delims=1234567890" %%a in ("!c!") do (
- for /f "tokens=* delims=0" %%b in ("!c:%%a=!") do (
- set /a m=%%b+10000000
- set "#!m!=|%%i-%%j-|%%a%%i-%%j-%%k"
- )
- )
- )
- for /f "tokens=1-4 delims=|" %%a in ('set #') do (
- set /a k+=1
- ren "%%d" "%%b!k!%%c"
- )
- endlocal
- popd
- )
- pause
复制代码
|