发新话题
打印

关于 [清除系统LJ.bat] 的分析和使用建议[个人]

关于 [清除系统LJ.bat] 的分析和使用建议[个人]

原文如下:
@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 清除系统LJ完成!  
echo. & pause

=====分析==============================================  
@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

%systemdrive%是环境变量,亦系统盘根目录
tmp文件建议保留,有很多程序的临时文件由于工程师的问题把临时文件放到了系统盘根目录
_mp文件同上
log文件是一些程序的日志文件,一般很少有把它放到系统盘根目录的,删了也无所谓
gid文件一般不会在根目录,见到了,那就删吧
chk文件同上
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\*.*                    等同于清楚cookies
del /f /q %userprofile%\recent\*.*                      删
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"       IE的临时文件,可以删
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"                                     用户临时文件,可删




可以看出,这种批处理不是很理想,而且像
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
两行完全可以去掉..
个人建议把删除OLD、BAK、TMP的行段删掉,避免引起某些程序出错
完毕..
发新话题