- @echo off
- setlocal enabledelayedexpansion
- for /d %%a in (*) do (
- set n=0
- pushd %%a
- for %%b in (*.jpg,*.mp4) do (
- set /a n+=1
- if "%%~xb"==".jpg" (set str1=%%b) else set str2=%%~nb
- )
- if !n! neq 2 (echo,请手动修改文件夹"%%a"中的文件名) else ren "!str1!" "!str2!.jpg"
- popd
- )
- pause
复制代码
|