“清除系统垃圾”批处理文件有错误

来源:百度文库 编辑:神马文学网 时间:2024/05/01 09:01:50
文章来源:黑蚂蚁论坛  原贴标题:“清除系统垃圾(让你电脑速度像飞一样)”的一个错误到底要害多少人才会停止? 一个错误到底要害多少人才会停止?   @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 /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 
 
  这是“清除系统垃圾(让你电脑速度像飞一样)”的链接,我知道这个批处理文件确实很好用,但是作者忽略了一个很重要的问题,导致很多电脑出现了一点不大不小的麻烦。希望菜鸟们在使用这个程序的时候能够注意一下。
 
  del /f /s /q %systemdrive%\*.log就是这行命令,我们可以看到,是删除后缀为log的文件,殊不知,在安装很多游戏或其他软件 的时候,会生成一个install.log的文件,该文件记录了安装程序复制了哪些文件,用于日后卸载该程序,可是执行了del /f /s /q %systemdrive%\*.log后,会不分青红皂白的把所有的LOG文件删除,这样在添加删除程序里卸载程序时,就会显示“无法找到 install.log文件,无法执行卸载”。 
 
  所以,做这个小文件的朋友们,一定要把“del /f /s /q %systemdrive%\*.log”这一行给去掉。要不然就会出现问题。 
 
  请各位注意啦!