将下面代码 另存为ANSI编码:- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=_"%%i in ('dir /b /a-d *.png') do set /a _%%i+=1
- for /f "tokens=1,2 delims==_" %%i in ('set _') do (
- set str1=0000%%j
- set str1=!str1:~-5!
- for /f "tokens=1,2 delims=-." %%a in ('dir /b /a-d %%i*.png') do (
- set str2=0000%%b
- set str2=!str2:~-5!
- ren "%%a-%%b.png" "【!str2!__!str1!】%%a-%%b.png"
- )
- )
- pause
复制代码 未测试 |