- @echo off & setlocal enabledelayedexpansion
-
- for /f %%i in ('dir /b/on *.jpg') do (
- findstr /i "^( (" %%i&&echo %%i>>1.txt
- findstr /i "-" %%i&&echo %%i>>2.txt
- )
-
- for /f "tokens=1,2 delims=()()" %%i in ('type 1.txt') do (
- set sz=0000%%j
- set sz=!sz:~-4,4!
- ren %%i(%%j).jpg %%i(!sz!).jpg
- )
-
- for /f "tokens=1,2 delims=-" %%i in ('type 2.txt') do (
- set sz=0000%%j
- set sz=!sz:~-4,4!
- ren %%i-%%j.jpg %%i-!sz!.jpg
- )
-
- del /q 1.txt 2.txt
- exit
复制代码 我的思路是这样,没有测试。 |