平时使用电脑时,运行程序和打开文档都会在系统中留下垃圾文件,尤其是windows系统更新日积月累更会留下大量垃圾文件,且这些垃圾文件都不会自动删除,久而久之导致系统慢若蜗牛!下面就让小编给大家说说电脑慢怎样彻底清理电脑系统垃圾吧。
电脑慢彻底清理电脑系统垃圾的方法
方法一 手动删除
打开“我的电脑”,进入以下目录,这些目录下的文件全部可删:
C:WINDOWSsystem32dllcache
C:WINDOWSPrefetch
C:WINDOWSTemp
C:WINDOWS下所有的补丁文件(隐藏文件)和日志文件(后缀为.log):
再打开本地个人帐号目录,路径是C:Documents and SettingsAdministratorLocal SettingsApplication Data,这些目录下的垃圾文件也可全部删除:如Cookies、Temp、Temporary Internet Files、Recent目录:
彻底清理磁盘:点击“开始”菜单中的“运行”,输入“cleanmgr /sageset:99”命令,点击“确定”后打开“磁盘清理设置”对话框,勾选全部的选项::
再运行“cleanmgr /sagerun:99”命令执行清理操作:
点击“确定”后开始执行清理工作,会依次弹出多个对话框:
请耐心等待清理工作执行完毕。
此方法烦锁且效率不高,不建议使用,建议使用方法二。
方法二 编写批处理自动清理
点击任务栏中的“开始”按钮,选择“所有程序”,再选择“附件”,再选择弹出菜单中的“记事本”,打开记事本程序:
将以下内容复制到记事本,另存为后缀为.bat的批处理文件:
@ECHO off
color 0a
REM [2012.08.11]
REM 增加优化自记功项功能
REM [2012.05.01]
REM 区分服务器和非服务器(已取消)
REM [2012.02.01]
REM 重点优化了本地帐户垃圾文件索引功能——减少了循环次数以减小系统资源占用
REM 修复细小Bug——修复个别因命令书写失误导致的功能失效问题
REM [2012.01.31]
REM 优化了清理顺序——将需要重点清除和资源占用小的功能优先执行
REM [2012.01.30]
REM 优化更为彻底——可全自动删除域环境下所有本地帐户下的垃圾文件、自动删除系统更新遗留的补丁文件
REM 针对家庭使用,增加了系统优化功能——自动判断是否需要优化,减少资源占用
::echo 当前帐户:%username%
ECHO.
ECHO ==本程序用于服务器时具有相当的危险性,请参照本程序源码REM操作!==
REM 服务器操作时这部分操作请勿使用!否则本人概不负责!
echo 禁止java后台更新程序自启动
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v SunJavaUpdateSched /f >nul 2>nul
echo 禁止Adobe Reader升级程序自启动
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v "Adobe ARM" /f >nul 2>nul
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v "Adobe Reader Speed Launcher" /f >nul 2>nul
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v Reader_sl /f >nul 2>nul
echo 禁止飞信自启动
reg delete HKEY_LOCAL_userSOFTWAREMicrosoftWindowsCurrentVersionRun /v Fetion /f >nul 2>nul
echo 禁止系统配置程序员自启动
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v MSConfig /f >nul 2>nul
echo 禁止日语输入法自启动
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v IMJPMIG8.1 /f >nul 2>nul
echo 禁止微软多语言支持自启动
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v IMEKRMIG6.1 /f >nul 2>nul
echo 禁止微软IME输入法组件自启动
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v IMSCMig /f >nul 2>nul
echo 禁止同步自启动
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v "Synchronization Manager" /f >nul 2>nul
echo 禁止微软拼音输入法2002自启动
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v MSPY2002 /f >nul 2>nul
echo 禁止微软拼音输入法组件自启动
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v PHIME2002A /f >nul 2>nul
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v PHIME2002ASync /f >nul 2>nul
reg delete HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v "Microsoft Pinyin IME Migration" /f >nul 2>nul
TITLE 清理.bak备份文件-谨慎操作!
del /f /s /q %windir%*.bak
REM 用于服务器时请勿删除日志!-谨慎操作!
TITLE 用于服务器时请勿删除日志!-谨慎操作!
del /f /s /q %systemdrive%*.log
REM 勿使用rd /s /q %windir%temp & md %windir%temp命令,否则服务器服务(如DB)容易出现问题!
del /f/s /q %windir%temp*.*
REM 若要清理帮助文件,将下面的::删除即可
rd /s /q "%windir%help"
ECHO ::1.清理局域网共享痕迹--注册表::
TITLE ::1.清理局域网共享痕迹--注册表::
reg delete "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerWorkgroupCrawlerShares" /f >nul 2>nul
ECHO ::2.清理运行或操作历史记录--注册表::
TITLE ::2.清理运行或操作历史记录--注册表::
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 "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUwav" /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 >nul 2>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 File List" /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 >nul 2>nul
ECHO ::3.清理IE浏览历史的下拉列表--注册表::
TITLE ::3.清理IE浏览历史的下拉列表--注册表::
reg delete "HKCUSoftwareMicrosoftInternet ExplorerTypedUrls" /va /f >nul 2>nul
ECHO ::4.正在清理常见系统垃圾文件,请退出360等程序::
TITLE ::4.正在清理常见系统垃圾文件,请退出360等程序::
del /f /q "%ALLUSERSPROFILE%DocumentsDrWatson*.*">nul 2>nul
del /f /s /q %systemdrive%*.tmp
del /f /s /q %systemdrive%*._mp
del /f /s /q %systemdrive%*.gid
del /f /s /q %systemdrive%*.chk
del /f /s /q %systemdrive%*.old
del /f /s /q %systemdrive%thumbs.db
del /f /s /q %systemdrive%recycled*.*
del /f /s /q %windir%system32dllcache*.*
del /f /s /q %windir%prefetch*.*
cls
ECHO ::5.为安全起见,以下清理操作只对当前登录帐户有效::
TITLE ::5.为安全起见,以下清理操作只对当前登录帐户有效::
del /f /s /q "%tmp%*.*"
ECHO ::6.清理文件缓存::
TITLE ::6.清理文件缓存::
SFC /purgecache
cls
ECHO ::7.清理系统升级补丁目录::
TITLE ::7.清理系统升级补丁目录::
dir %SystemRoot%$*$ /ad/b >%SystemRoot%DirTmp.txt
for /f %%a in (%SystemRoot%DirTmp.txt) do rd /s /q "%SystemRoot%%%a"
del /f /q %SystemRoot%DirTmp.txt
cls
ECHO ::8.清理磁盘错误检测文件::
TITLE ::8.清理磁盘错误检测文件::
dir %SystemDrive%found.??? /ad/b >%systemDrive%DirTmp.txt
for /f %%a in (%systemDrive%DirTmp.txt) do rd /s /q "%systemDrive%%%a"
del /f /q %systemDrive%DirTmp.txt
cls
ECHO ::9.正在清理所有(域)帐户下的所有临时文件,请稍候::
TITLE ::9.正在清理所有(域)帐户下的所有临时文件,请稍候::
dir "%SystemDrive%Documents and Settings" /ad/b >%SystemDrive%DirTmp.txt
for /f %%a in (%SystemDrive%DirTmp.txt) do del /f /s /q "%SystemDrive%Documents and Settings%%aCookies*.*"&del /f /s /q "%SystemDrive%Documents and
Settings%%aRecent*.*"&rd /s /q "%SystemDrive%Documents and Settings%%aLocal SettingsHistory"&del /f /s /q "%SystemDrive%Documents and Settings%%
aLocal SettingsTemp*.*"&del /f /s /q "%SystemDrive%Documents and Settings%%aLocal SettingsTemporary Internet Files*.*"
del /f /q %SystemDrive%DirTmp.txt
cls
ECHO ::10.删除系统驱动备份文件,释放空间::
TITLE ::10.删除系统驱动备份文件,释放空间::
rd /s /q %SystemDrive%swsetup
ECHO ::11.正在进行系统优化::
TITLE ::11.正在进行系统优化::
reg delete "HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun" /v TkBellExe /f
cls
ECHO ::12.正在进行最后一步——磁盘清理,完成后自动退出::
ECHO 当耗时越长时,说明你系统垃圾越多,请耐心等待程序执行完毕。。。
TITLE ::12.正在进行最后一步——磁盘清理,完成后自动退出::
cleanmgr /sagerun:99
exit
设置磁盘清理选项:点击“开始”菜单中的“运行”,输入“cleanmgr /sageset:99”命令,点击“确定”后打开“磁盘清理设置”对话框,参照方法一中图片。
再执行保存的.bat程序,开始自动清理:
因为程序中一并清理了注册表中的垃圾文件(Reg语句),所以执行此程序时建议关闭360,或者弹出360提示时选择允许操作即可。
以后在需要时双击执行此程序即可。
方法三 利用360清理垃圾功能自动清理
打开360安全卫士,切换到“电脑清理”功能块,选择“一键清理”栏;
点击“右边”的“自动清理”按钮,勾选下面的三个复选框,同时建议在下面清理频率中选择为“每周”:
切换到“清理垃圾”栏,先点击右下角的“设置”按钮,在弹出的“清理垃圾设置”窗口上单击下面的“全选”,单击“确定”:
退出“清理垃圾设置”窗口后单击“开始扫描”按钮即可。
再切换到“清理痕迹”栏,单击“高级设置”按钮,在弹出的“高级设置”窗口中选择“全选”,单击“确定”,退出“高级设置”窗口后单击“开始扫描”按钮开始扫描垃圾:
建议不要“全选”,只选择你有安装过的软件即可。
扫描完成后执行“立即清理”工作。