这样省略临时文件- @echo off&setlocal enabledelayedexpansion
- %1(for /f "tokens=*" %%i in ('%~s0 :^|sort /r') do ren %%i)&pause&exit
- for /f "tokens=*" %%i in ('dir /ad /b /s') do (
- set "file=%%i"
- set "str1=%%~dpi"
- if "!str1!" neq "!str2!" (
- set "n=1"
- ) else set /a n+=1
- echo "!file!" "!n!_%%~nxi"
- set "str2=%%~dpi"
- )
复制代码
|