@echo off
pushd "%~dp0"
for /f "delims=" %%x in ('dir /a:d /b') do (
pushd ".\%%x"
for /r . %%a in (*.jpg *.doc) do if exist "%%a" move /y "%%a" .
for /f "delims=" %%i in ('dir /ad /b /s ^|sort /r') do (
rd "%%i">nul 2>nul &&if not exist %%i\ echo 成功删除:%%i
)
popd
)
pause