批处理清除垃圾文件...经典

本文提供了一个批处理脚本,用于自动清理Windows系统中的临时文件、缓存、日志及回收站等内容,适用于Windows XP及以上版本。对于Windows 7及更高版本,需要使用管理员权限运行。

批处理指令如下:

 1 @echo off
 2 echo 正在清除系统垃圾文件,请稍等......
 3 @del /f /s /q %systemdrive%\*.tmp
 4 @del /f /s /q %systemdrive%\*._mp
 5 @del /f /s /q %systemdrive%\*.log
 6 @del /f /s /q %systemdrive%\*.gid
 7 @del /f /s /q %systemdrive%\*.chk
 8 @del /f /s /q %systemdrive%\*.old
 9 @del /f /s /q %systemdrive%\recycled\*.*
10 @del /f /s /q %windir%\*.bak
11 @del /f /s /q %windir%\prefetch\*.*
12 @rd /s /q %windir%\temp & md %windir%\temp
13 @del /f /q %userprofile%\cookies\*.*
14 @del /f /q %userprofile%\recent\*.*
15 @del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
16 @del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
17 @del /f /s /q "%userprofile%\recent\*.*"
18 echo 清除系统垃圾完成!

将以上的指令保存到事先定义好的文件上:clearsys.bat(可用记事本打开);也可以直接到这里下载:http://pan.baidu.com/share/link?shareid=154455&uk=2769149514

在windows XP环境下可以直接双击执行即可;而在windows 7以上版本须用管理员身份运行方可删除有权限的垃圾文件!!!

如果有不足之处请指教!!!

转载于:https://www.cnblogs.com/wolfxin2010/archive/2012/12/02/2798164.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值