经典代码,一个简单的清除C盘垃圾bat程序

2016年04月24日 技术资料 6048 views 0

这篇看起来没技术含量,回想刚接触电脑知识的时候,对各种技巧都很感兴趣,是一种回味。
这里bat清理也是网上找的,但是部分代码优化过,本机已经测试,xp系统下,清理后一切正常。
这个bat文件只做研究用,清理垃圾还是建议使用工具来的方便和安全。
现在来说,工具太多了,而且现在很多人多用win7了。清理win7可能会有问题,所以不要用了。

打开记事本,输入一下代码:

@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 清除系统垃圾完成! 
echo. & pause



保存为后缀名.bat 例如clear.bat

👍好活当赏🧧