本帖最后由 qixiaobin0715 于 2021-6-9 18:38 编辑
回复 3# ykhq2021
如果像你所说的那么规律的话,可以这样:- @echo off
- setlocal enabledelayedexpansion
- for /d %%i in (*) do (
- pushd "%%i"
- set /a n=10000,x1=0,y1=0
- for /f "delims=" %%a in ('dir /b /a-d') do (
- set "str=%%~na"
- if "!str:~-1!"=="+" (
- set /a x1+=1
- set /a x2=2*x1+n
- ren "%%a" "!x2:~1!%%~xa"
- ) else (
- set /a y1+=1
- set /a y2=2*y1-1+n
- ren "%%a" "!y2:~1!%%~xa"
- )
- )
- popd
- )
- pause
复制代码 未测试 |