回复 1# alwaysra
test.bat 放在 C:\商品\ 下面执行- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('dir /b /s /ad') do (
- pushd "%%a"
- echo 正在处理子文件夹 %%a
- set "FileNum=0"
- for /f "delims=" %%b in ('dir /b /s /a-d *.png') do (
- set /a FileNum+=1
- ren "%%b" "%%a-!FileNum!%%~xb"
- )
- popd
- )
复制代码 请参考Q-04把bat文件保存为ANSI编码:
https://mp.weixin.qq.com/s/6lbb97qUOs1sTyKJfN0ZEQ |