放到jpg文件夹中运行- @echo off & cd /d "%~dp0"
- set "zero=000"
- for %%i in ("*.jpg") do (
- set "head=" & set "foot="
- call :split "%%~ni"
- call set "foot=%zero%%%foot%%"
- call set "foot=%%foot:~-3%%"
- echo %%i
- call echo %%head%%%%foot%%.jpg
- call move "%%i" "%%head%%%%foot%%.jpg"
- echo ---------------------------
- )
- pause&exit
-
- :split
- set "str=%~1"
- if not "%str:~-1%"=="-" (
- set "head=%str:~0,-1%"
- set "foot=%str:~-1%%foot%"
- call :split "%%head%%"
- ) else goto :eof
复制代码
|