富贵资源网 Design By www.hznty.com

del 命令的参数
/F 强制删除只读文件。
/S 从所有子目录删除指定文件。
/Q 安静模式。删除全局通配符时,不要求确认。

rd 命令的参数
/s 除目录本身外,还将删除指定目录下的所有子目录和文件。用于删除目录树。
/q 安静模式
/s 删除目录树时不要求确认。

代码一

@echo off & title 清理系统垃圾
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*.mp3
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 /s /q "C:\Documents and Settings\Administrator\Local Settings\History"
del /f /s /q "C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files"
del /f /s /q "C:\Documents and Settings\Administrator\Local Settings\Temp"
del /f /s /q "C:\Documents and Settings\Administrator\Local Settings\Temp\_xl7vss_"
del /f /s /q "D:\Program Files\QvodPlayer\Data" 

代码二

@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\*.*" 
echo 清理系统垃圾完成! 

然后把上面的内容保存为 清理垃圾批处理.bat,当然大家可以根据自己的需求增减目录或文件类型即可。

富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com