我要投稿 投诉建议

电脑运行缓慢怎么解决

时间:2020-11-29 17:13:08 电脑知识 我要投稿

电脑运行缓慢怎么解决

  导读:电脑在使用的过程中会产生很多垃圾,垃圾多了,电脑运行的速度就慢得厉害了!现在我们可以用一个小程序来把这些垃圾从我们的电脑里清除掉!下面小编来教大家这么制作这个小程序,希望对大家有帮助。

电脑运行缓慢怎么解决

  工具/原料

  文本文档文件一个

  步骤/方法

  首先我们就新建一个文本文档文件!我们鼠标右键就能新建一个文本文档文件了!我们可以在桌面鼠标右键菜单,选择“新建”,然后再选择“文本文档”!就能在桌面新一个空白的文本文档文件了!

  现在我们就要打开新建的文本文档文件!里面什么都没有,空空如也!我们要在这里进行编辑啦!在文本文档文件里输入一些程序代码!这些代码如下!

  @ECHO off

  color 0a

  ::echo 当前帐户:%username%

  ECHO.

  echo 请选择是否用于服务器:

  echo.

  echo 1.是服务器-- 按任意数字键

  echo 2.非服务器-- 按回车或其它任意键

  echo.

  set /p s=请选择:

  echo %s%|findstr /be "[0-9]*" >nul &&goto:server||goto:PC

  ::if /i "%s%" equ "Y" goto:server else goto:pc

  :PC

  ECHO ==本程序用于服务器时具有相当的危险性,请参照本程序源码REM操作!==

  REM 服务器操作时这部分操作请勿使用!否则本人概不负责!

  TITLE 清理.bak备份文件-谨慎操作!

  del /f /s /q %windir%*.bak

  REM 用于服务器时请勿删除日志!-谨慎操作!

  TITLE 用于服务器时请勿删除日志!-谨慎操作!

  del /f /s /q %systemdrive%*.log

  REM 勿使用rd /s /q %windir% emp & md %windir% emp命令,否则服务器服务(如DB)容易出现问题!

  ::del /f/s /q %windir% emp*.*

  REM 若要清理帮助文件,将下面的::删除即可

  ::rd /s /q "%windir%help"

  goto:server

  :server

  ECHO ::1.清理局域网共享痕迹--注册表::

  TITLE ::1.清理局域网共享痕迹--注册表::

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerWorkgroupCrawlerShares" /f >nul 2>nul

  ECHO ::2.清理运行或操作历史记录--注册表::

  TITLE ::2.清理运行或操作历史记录--注册表::

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocsFolder" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.txt" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.rar" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.mp3" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.jpg" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.ini" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.bmp" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.doc" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.eip" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.htm" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.ico" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.inf" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.gif" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.wav" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.xls" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs.rm" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32LastVisitedMRU" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRU*" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUmp3" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUm" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUwav" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUat" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUexe" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUeip" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUico" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUhtm" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerComDlg32OpenSaveMRUjpg" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRunMRU" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerStreamMRU" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerUserAssist{5E6AB780-7743-11CF-A12B-00AA004AE837}Count" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerUserAssist{75048700-EF1F-11D0-9888-006097DEACF9}Count" /va /f >nul 2>nul

  reg "HKCUSoftwareWinRARArcHistory" /va /f >nul 2>nul

  reg "HKCUSoftwareWinRARDialogEditHistoryArcName" /va /f >nul 2>nul

  reg "HKCUSoftwareWinRARDialogEditHistoryExtrPath" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftMediaPlayerPlayerRecentFileList" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftMicrosoft Management ConsoleRecent File List" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftOffice11.0PowerPointRecent File List" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftOffice11.0ExcelRecent File" /va /f >nul 2>nul

  reg "HKCUSoftwareMicrosoftOffice11.0WordData" /v "Settings" /f >nul 2>nul

  reg "HKCUSoftwareVMware, Inc." /va /f >nul 2>nul

  ECHO ::3.清理IE浏览历史的下拉列表--注册表::

  TITLE ::3.清理IE浏览历史的下拉列表--注册表::

  reg "HKCUSoftwareMicrosoftInternet ExplorerTypedUrls" /va /f >nul 2>nul

  ECHO ::4.正在清理常见系统垃圾文件=::

  TITLE ::4.正在清理常见系统垃圾文件::

  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% humbs.db

  del /f /s /q %systemdrive%ecycled*.*

  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.正在进行系统优化::

  echo 禁用RealPlayer更新和开机项

  ::清理右键ATI显卡选项--ATI CATALYST(R) Control

  ::if exist "%windir%system32atiacmxx.dll" (regsvr32 /u "%windir%system32atiacmxx.dll")

  ::清理右键Intel显卡选项

  ::if exist "%windir%system32igfxpph.dll" regsvr32 /u "%windir%system32igfxpph.dll"

  ::清理右键NVIDIA显卡选项

  ::if exist "%windir%system32 vcpl.dll" regsvr32 /u "%windir%system32 vcpl.dll"

  ::清理realplayer更新

  if exist "%ProgramFiles%Common~1RealUpdate_OBealsched.exe" ren "%ProgramFiles%Common~1RealUpdate_OBealsched.exe" realsched.ex_

  if exist "%ProgramFiles%Common~1RealUpdate_OBealsched.exe" del /f /s /q "%ProgramFiles%Common~1RealUpdate_OBealsched.exe"

  reg "HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun" /v TkBellExe /f

  cls

  ECHO ::12.正在进行最后一步——磁盘清理,完成后自动退出::

  ECHO 当耗时越长时,说明你系统垃圾越多,请耐心等待程序执行完毕。。。

  TITLE ::12.正在进行最后一步——磁盘清理,完成后自动退出::

  cleanmgr /sagerun:99

  exit

  现在我们要在我们的电脑里设置一下!把我们文件的扩展名显示出来!这样我们就能修改文件的扩展名了!我们随便用一个文件夹,打开“组织”菜单,然后“文件夹和搜索选项”!在选项卡里选择查看,然后把“隐藏已知文件类型的扩展名”前面的钩去掉!

  把这个文本文件另存为BAT文件!我们可以直接保存好这个TXT文件,之后把TXT的`扩展名改为BAT的;也可以另存,这时候在文件名那里把扩展名改为BAT的也是可以的!

  如果安装了360的一些软件的,我们就先要把360的软件退出!如果不退出就会有一些提示,我们就要允许它就行了!不要阻止,阻止了程序会运行不下去!

  现在我们就运行一下我们之前做好的软件吧!我们要选择一下,我们的就选择不是服务器2吧!现在我们就能看程序在一个一个地清除系统中的垃圾文件了!

  现在我们就用一些常用的软件来检测一下我们的电脑还有多少垃圾吧!嘻嘻…两个软件的检测到的垃圾都不多!是不是很有用呢?赶快自己动手做一个吧!

  END

  注意事项

  垃圾清除会把系统日志、补丁也清掉!

【电脑运行缓慢怎么解决】相关文章:

电脑时间缓慢怎么解决11-29

电脑运行慢怎么解决11-21

电脑cpu运行慢怎么解决11-29

电脑运行很卡的解决办法11-24

电脑声音小怎么解决11-22

宏基电脑白屏怎么解决12-30

电脑卡慢怎么解决11-29

电脑慢卡怎么解决11-29

电脑上网慢怎么解决11-29