@echo off
rem 遍历所有货号目录
for /d %%d in (*) do (
rem 进入当前货号目录
cd "%%d\%%d"
rem 移动主图到货号根目录
move "主图\主图1.jpg" ..\..\%%d\E-01.jpg 2>nul
move "主图\主图2.jpg" ..\..\%%d\E-02.jpg 2>nul
move "主图\主图3.jpg" ..\..\%%d\E-03.jpg 2>nul
move "主图\主图4.jpg" ..\..\%%d\E-04.jpg 2>nul
move "主图\主图5.jpg" ..\..\%%d\M.jpg 2>nul
rem 移动包含"详情页"的图片到货号根目录
for %%f in ("images\*详情页*.jpg") do (
move "%%~ff" ..\..\%%d 2>nul
)
for %%f in ("images\*详情页*.png") do (
move "%%~ff" ..\..\%%d 2>nul
)
rem 删除主图目录和images目录
rd /s /q "主图"
rd /s /q "images"
rem 返回上一层目录
cd ..\..
rem 删除当前货号目录
rd /s /q "%%d/%%d"
)
echo 操作完成!
pause