2018年2月3日 星期六

清除系統垃圾檔案










系統長時間運行之後.會出現一堆無用的檔案占用硬碟空間.降低執行效率
可將下列文字存成批次檔執行.清除這些無用檔案
但請注意有(少部分軟體安裝時)會在系統建立log檔
在移除時會用到.所以第三行*.log的刪除與否.請自行衡量

@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

沒有留言:

張貼留言