001011 当前离线
六级士官
jyswjjgdwtdtj 当前离线
中尉
TOP
77七 当前离线
中校
@echo off rem 假设每个文件夹内图片数量均不超过100 setlocal enabledelayedexpansion for /f "delims=" %%i in ('dir /b /ad') do ( pushd "%%i" for /l %%l in (1,1,100) do ( if exist %%l.jpg ( set /a "m=(%%l+4)%%4" if "!m!" equ "1" ( set /a n=%%l+3 ) else ( set /a n=%%l-1 ) ren %%l.jpg !n!.jpg1 ) ) ren *.jpg1 *.jpg popd ) endlocal pause复制代码
评分人数
buyiyang 当前离线
setlocal enabledelayedexpansion for /d %%i in (*) do ( pushd "%%i" set /a n=10000 for %%a in (*.jpg) do ( set /a n+=1 set /a m=n%%4 if !m! equ 1 (set /a s=n+3) else ( set /a s=n-1 ) ren "%%a" "!s:~1!.jpg" ) popd ) pause复制代码
@echo off rem 假设每个文件夹内图片数量均不超过1000 setlocal enabledelayedexpansion for /f "delims=" %%i in ('dir /b /ad') do ( pushd "%%i" for /l %%l in (1,1,1000) do ( set k=000%%l set k=!k:~-4! if exist !k!.jpg ( set /a "m=(%%l+4)%%4" if "!m!" equ "1" ( set /a "n=%%l+3" ) else ( set /a "n=%%l-1" ) set n=000!n! echo ren !k!.jpg !n:~-4!.jpg1 ren "!k!.jpg" "!n:~-4!.jpg1" ) ) ren *.jpg1 *.jpg popd ) endlocal pause复制代码
qixiaobin0715 当前离线
大校
@echo off set /a #1=3,#2=#3=#0=-1 setlocal enabledelayedexpansion for /f "delims=" %%i in ('dir /b /s /a-d *.jpg') do ( set /a n=%%~ni%%4 set /a m=%%~ni+#!n! set m=000!m! ren "%%i" "!m:~-4!%%~xi" ) pause复制代码
@echo off setlocal enabledelayedexpansion for /f "delims=" %%a in ('dir /b /s /a-d *.jpg') do ( for /f "tokens=* delims=0" %%b in ("%%~na") do ( set /a "p=%%b%%4" if !p! equ 1 ( set /a "n=10000+%%b+3" ) else ( set /a "n=10000+%%b-1" ) ren "%%a" !n:~-4!.jpg1 ) ) ) endlocal for /r %%a in (*.jpg1) do ( ren "%%a" "%%~na.jpg" ) pause复制代码
@echo off setlocal enabledelayedexpansion for /f "delims=" %%a in ('dir /b /s /a-d *.jpg') do ( set "m=1%%~na" set /a "p=!m!%%4" if !p! equ 1 ( set /a "n=!m!+3" ) else ( set /a "n=!m!-1" ) ren "%%a" !n:~-4!.jpg1 ) endlocal for /r %%a in (*.jpg1) do ( ren "%%a" "%%~na.jpg" ) pause复制代码
@echo off set /a #1=3,#2=#3=#0=-1 setlocal enabledelayedexpansion for /f "delims=" %%i in ('dir /b /s /a-d *.jpg') do ( for /f "tokens=* delims=0" %%j in ("%%~ni") do ( set /a n=%%j%%4 set /a m=%%j+#!n! set m=0000!m! ren "%%i" "!m:~-5!%%~xi" ) ) pause复制代码
newswan 当前离线
上尉
@echo off setlocal EnableDelayedExpansion for /l %%a in (1,1,10) do ( call :c %%a ) pause exit :c set/a n1=%1 set/a r = %1 %% 4 if %r% equ 1 ( set /a n2 = n1 + 3 ) else ( set /a n2 = n1 - 1 ) set n1 = 0000%n1% set n2 = 0000%n2% set n1 = %n1:~4% set n2 = %n2:~4% echo %n1% n%n2% goto :eof复制代码
aloha20200628 当前在线