标题: [系统相关] [代码征集]批处理删除系统垃圾 [打印本页]
作者: youxi01 时间: 2007-12-6 18:46 标题: [代码征集]批处理删除系统垃圾
这个是老题材了,有很多的源代码,参考代码(转自黑蚂蚁):
- @echo off 转自黑蚂蚁www.hackant.com
- echo 正在清除系统垃圾文件,请稍等...... 转自黑蚂蚁www.hackant.com
- del /f /s /q %systemdrive%\*.tmp 转自黑蚂蚁www.hackant.com
- del /f /s /q %systemdrive%\*._mp 转自黑蚂蚁www.hackant.com
- del /f /s /q %systemdrive%\*.log 转自黑蚂蚁www.hackant.com
- del /f /s /q %systemdrive%\*.gid 转自黑蚂蚁www.hackant.com
- del /f /s /q %systemdrive%\*.chk 转自黑蚂蚁www.hackant.com
- del /f /s /q %systemdrive%\*.old 转自黑蚂蚁www.hackant.com
- del /f /s /q %systemdrive%\recycled\*.* 转自黑蚂蚁www.hackant.com
- del /f /s /q %windir%\*.bak 转自黑蚂蚁www.hackant.com
- del /f /s /q %windir%\prefetch\*.* 转自黑蚂蚁www.hackant.com
- rd /s /q %windir%\temp & md %windir%\temp 转自黑蚂蚁www.hackant.com
- del /f /q %userprofile%\cookies\*.* 转自黑蚂蚁www.hackant.com
- del /f /q %userprofile%\recent\*.* 转自黑蚂蚁www.hackant.com
- del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" 转自黑蚂蚁www.hackant.com
- del /f /s /q "%userprofile%\Local Settings\Temp\*.*" 转自黑蚂蚁www.hackant.com
- del /f /s /q "%userprofile%\recent\*.*" 转自黑蚂蚁www.hackant.com
- echo 清除系统LJ完成! 转自黑蚂蚁www.hackant.com
- echo. & pause 转自黑蚂蚁www.hackant.com
- 转自黑蚂蚁www.hackant.com
复制代码
重写题材的代码要求:
1、更加精练、简洁;
2、涉及内容更全,也更安全
3、最好配有解释...
作者: 随风 时间: 2007-12-7 15:22
精练谈不上,我都不知道到底哪些才是系统垃圾。
帖一段我自己用的上来看看。
:- @echo off
- echo 垃圾清理正在运行,请稍后…………
- rd /s /q %windir%\temp & md %windir%\temp
- del /f /s /q %windir%\*.bak
- del /f /q "%userprofile%\cookies\*.*"
- for %%a in (tmp _mp log gid chk old) do (
- del /f /s /q "%systemdrive%\*.%%a"
- )
- del /f /s /q "%systemdrive%\recycled\*.*"
- del /f /s /q "%windir%\prefetch\*.*"
- del /f /s /q "%userprofile%\recent\*.*"
- del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
- del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
-
- ::清除文件缓存 XP系统是:C:\windows\system32\dllcache下的所有文件 清理系统缓存
- sfc /purgecache
- color 0a&echo 清除系统垃圾文件完成!
- echo\&pause&exit
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |