不清楚你的实际文件/情况,仅以问题中的样例说明及猜测为据;以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI,跟要处理的多个子文件夹放一起双击运行
cls&echo off&cd /d "%~dp0"&mode con lines=5000
rem 清空/删除当前目录下多个子文件夹里的文件和文件夹
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
for /f "delims=" %%a in ('dir /ad-h/b') do (
for /f "delims=" %%b in ('dir /a/b "%%a\" 2^>nul') do (
echo;delete "%%a\%%~nxb"
)
)
echo;%#% +%$%%$%/%_% %z%
pause
exit
cls&echo off&cd /d "%~dp0"&mode con lines=5000
rem 清空/删除当前目录下多个子文件夹里的文件和文件夹
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
for /f "delims=" %%a in ('dir /ad-h/b') do (
for /f "delims=" %%b in ('dir /a/b "%%a\" 2^>nul') do (
echo;delete "%%a\%%~nxb"
)
)
echo;%#% +%$%%$%/%_% %z%
pause
exit