本帖最后由 77七 于 2024-3-14 12:46 编辑
回复 3# 单车少男
- @echo off
- cd /d "%~dp0"
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /b /a-d "* - *v*.*"^|find /v "%~nx0"') do (
- for /f "tokens=1-3 delims=v- " %%a in ("%%~ni") do (
- set /a n=%%c+1000000,m=%%c+1
- set #"%%b"#"!n!"#"%%i"=%%a - %%bv!m!%%~xi
- )
- )
- for /f "tokens=1-4 delims=#=" %%a in ('set # ^|sort /r') do (
- if not defined _"%%~a" (
- ren "%%~c" "%%d"
- set _"%%~a"=1
- )
- )
- endlocal
- pause
复制代码
|