两种一键清理系统垃圾代码及制作方法
一、一键清理系统垃圾.bat
echo-----------------------------------------------------------------------------
echo 清空IE临时文件目录...
del /f /s /q "%userprofile%Local SettingsTemporaryInternet Files*.*"
del/f /s /q "%userprofile%LocalSettingsTemp*.*"
echo 正在清除系统临时文件 *.tmp *._tmp*.log *.chk *.old ,请稍等...
del/f /s /q%systemdrive%*.tmp
del/f /s /q%systemdrive%*._mp
rem.log大部分有可能有用
rem del /f/s /q %systemdrive%*.log
del/f /s /q%systemdrive%*.gid
del/f /s /q%systemdrive%*.chk
del/f /s /q%systemdrive%*.old
echo 清空垃圾箱,备份文件和预缓存脚本...
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
remcooke和最近历史还是保留吧...
rem del /f/q %userprofile%COOKIES s*.*
rem del /f/q %userprofile%recent*.*
echo 清理系统盘无用文件...
%windir%system32sfc.exe /purgecache
echo 优化预读信息...
%windir%system32defrag.exe %systemdrive% -b
echo 清除系统完成!
echo-----------------------------------------------------------------------------
将上面的文件存为“一键清理系统垃圾.bat”,然后双击运行即可。
建议:最好是一周运行一次清理。
二、超级一键删除垃圾.bat代码
@echooff
color0A
title 历史痕迹兼系统垃圾清理 beta1.0
::全盘删除Thumbs.db(缩略图缓存文件)
@echooff&setlocal enabledelayedexpansion
for /f"delims=" %%i in ('fsutil fsinfo drives^|find""') do (
setdrive_=%%i
fsutilfsinfo drivetype !drive_:~0,2!|find "固定">nul&& del /a /f /q /s!drive_:~0,2!Thumbs.db
)
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%*.tmp
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%LocalSettingsTemporary Internet Files*.*"
del/f /s /q "%userprofile%LocalSettingsTemp*.*"
del/f /s /q"%userprofile%recent*.*"
del/f /q"%ALLUSERSPROFILE%DocumentsDrWatson*.*">nul2>nul
del/f /q"%USERPROFILE%ApplicationDataMicrosoftOfficeRecent*.lnk">nul2>nul
::清理局域网共享痕迹
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerWorkgroupCrawlerShares"/f >nul 2>nul
::用户运行或操作历史记录
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocsFolder"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.txt"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.rar"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.mp3"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.jpg"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.ini"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.bmp"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.doc"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.eip"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.htm"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.ico"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.inf"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.gif"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.wav"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.xls"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.rm"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32LastVisitedMRU"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRU*"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUmp3"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUrm"/va /f >nul 2>nul
reg delete"HKCUSof--twareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUwav"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUbat"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUexe"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUeip"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUico"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUhtm"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUjpg"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRunMRU"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerStreamMRU"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerUserAssist{5E6AB780-7743-11CF-A12B-00AA004AE837}Count"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerUserAssist{75048700-EF1F-11D0-9888-006097DEACF9}Count"/va /f >nul 2>nul
reg delete"HKCUSoftwareWinRARArcHistory" /va /f >nul2>nul
reg delete"HKCUSoftwareWinRARDialogEditHistoryArcName" /va /f>nul 2>nul
reg delete"HKCUSoftwareWinRARDialogEditHistoryExtrPath" /va /f>nul 2>nul
reg delete"HKCUSoftwareMicrosoftMediaPlayerPlayerRecentFileList" /va /f>nul 2>nul
reg delete"HKCUSoftwareMicrosoftMicrosoft Management ConsoleRecent FileList" /va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftOffice11.0PowerPointRecent File List"/va /f >nul 2>nul
reg delete"HKCUSoftwareMicrosoftOffice11.0ExcelRecent File" /va /f>nul 2>nul
reg delete"HKCUSoftwareMicrosoftOffice11.0WordData" /v "Settings" /f>nul 2>nul
reg delete"HKCUSoftwareVMware, Inc." /va /f >nul2>nul
::清理IE浏览历史的下拉列表
reg delete"HKCUSoftwareMicrosoftInternet ExplorerTypedUrls" /va /f>nul 2>nul
echo-----------------------------------------------------------------------------
将上面的文件存为“超级一键删除垃圾.bat”,然后双击运行即可。