用临时文件过度下- @echo off&setlocal enabledelayedexpansion
- (for /f "skip=2 tokens=*" %%i in ('dir /s /ad') do (
- set "str=%%i"
- if exist "!str:~,-4!\" (
- set "files=!str:~,-4!"&set n=0
- ) else for /f "tokens=*" %%a in ("!str:*>=!") do (
- if exist "!files!\%%~nxa\" if "%%~nxa" neq "" (
- set /an+=1
- echo ren "!files!\%%a" "!n!%%a"
- )
- )
- ))>$
- sort /r $>Ren_files.cmd
- call Ren_files.cmd
- del $ Ren_files.cmd
- pause
复制代码
|