加了判断 前面有没有0
有没有三位数的?- @echo off
- SETLOCAL ENABLEDELAYEDEXPANSION
-
- cd %~dp0
-
- set order16= 08 09 10 07 06 11 12 05 04 13 14 03 02 15 16 01
-
- set f=%1
- for /f "delims=" %%i in ('dir /b /s /a-d "%f%" 2^>nul ^| find /c /v ""') do (
- set n=%%i
- )
-
- echo,
- echo folder: %f%
- echo file count: %n%
- echo,
-
- pushd %f%
- cd
- set order=!order%n%!
- set/a i=0
- for %%a in ( %order% ) do (
- set/a i+=1
- if exist 测试_!i!.jpg (set j=!i!) else (set j=0!i!)
- echo ren 测试_!j!.jpg %%a.jpg
- )
- popd
-
- echo,
- echo, complete
-
- pause
复制代码
|