1. 程式人生 > 實用技巧 >Win垃圾清理.bat

Win垃圾清理.bat

Win垃圾清理.bat

@echo off 
color 0b
echo ==正在清除系統垃圾檔案,請稍後...... 
echo ==在程式沒有結束的資訊時,請勿關閉本視窗
echo ==1.
echo ==刪除臨時檔案
del /f /s /q %systemdrive%\*.tmp 
del /f /s /q %systemdrive%\*._mp 
rd /s /q %windir%\temp & md %windir%\temp
del /f /s /q "%userprofile%\local settings\temp\*.*" 
del /f /s /q %windir%\prefetch\*.* 
echo ==2.
echo ==刪除日誌檔案
echo ==刪除幫助索引檔案
echo ==刪除磁碟掃描留下的臨時檔案
echo ==刪除備份檔案
echo ==刪除舊備份檔案
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid 
del /f /s /q %systemdrive%\*.chk 
del /f /s /q %windir%\*.bak 
del /f /s /q %systemdrive%\*.old 
::echo ==3.
::echo ==清空回收站
::del /f /s /q c:\$recycle.bin\*.*
::del /f /s /q d:\$recycle.bin\*.*
::del /f /s /q e:\$recycle.bin\*.*
::del /f /s /q f:\$recycle.bin\*.*
::del /f /s /q g:\$recycle.bin\*.*
echo ==4.
echo ==刪除自動更新後留下的軟體
rd /s /q %windir%\SoftwareDistribution\Download & md %windir%\SoftwareDistribution\Download
::echo ==5.
::echo ==刪除上網產生的Cookies
::del /f /q "%userprofile%\AppData\Roaming\Microsoft\Windows\Cookies\*.*"
::echo ==6.
::echo ==刪除上網產生的臨時檔案
::del /f /s /q "%userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"
echo ==7.
echo ==執行私隱保護
del /f /s /q "%userprofile%\AppData\Roaming\Microsoft\Windows\Recent\*.*" 
echo 已清理完成!          
echo. & pause