admin 管理员组

文章数量: 1184232

系统垃圾既占空间,又可能暗藏病毒。手动清除费事,建议用批处理。

1。准备知识

a.环境变量,运行/cmd/set,可以看到

"%userprofile%,系统当前用户的文件夹,平时产生的垃圾主要在这里

"%userprofile%/recent   最近的文档

"%userprofile%/local settings/Temp

"%userprofile%/local settings/History                                ie历史

"%userprofile%/local settings/Temporary Internet Files   ie临时文件

b.Del命令

/q       安静  /s 包括子目录 /f 强制

2.批处理脚本

echo 正在清除系统垃圾文件,请稍等......

del /f /q %userprofile%/recent/*.*

del /f /s /q "%userprofile%/Local Settings/Temp/*.*"

del /f /s /q "%userprofile%/Local Settings/History/*.*"

del /f /s /q "%userprofile%/Local Settings/Temporary Internet Files/*.*"

echo 清除系统垃圾完成!

3.更全的垃圾删除脚本

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 清除系统垃圾完成!

本文标签: 系统垃圾 正在清除 编程