求达人写一个批处理,删除某文件夹下的所有名字为XXX的文件夹(包含子文件夹)

来源:百度知道 编辑:UC知道 时间:2024/06/10 11:58:34
有个项目文件夹,编译后会在其下的许多子目录,甚至子目录的子目录里产生许多名为"XXX"的文件夹.帮我写个批处理删除谢谢.比如:
c:\ky15\abc1\XXX
c:\ky15\abc2\XXX
c:\ky15\abc3\aaa1\XXX
c:\ky15\abc3\aaa2\XXX
c:\ky15\abc4\aaa1\ccc\XXX
....

@echo off
for /r c:\ky15 %%i in (.) do (
pushd %%i
if exist .\XXX\ rd /s /q XXX
)

@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent&#