找回密码
 加入
搜索
查看: 5596|回复: 5

[原创] XP系统常用清理优化程序(发错地方了,帮我转一下)

[复制链接]
发表于 2010-11-24 19:05:08 | 显示全部楼层 |阅读模式
本帖最后由 gzh888666 于 2010-12-23 23:02 编辑
Func _System();系统优化
;不显示隐藏文件
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", "0")
;显示文件扩展名
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", "0")
;隐藏系统文件
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowSuperHidden", "REG_DWORD", "0")
;菜单运行速度
RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "MenuShowDelay", "REG_SZ", "0")
; 去除快捷方式的箭头
RegDelete("HKEY_CLASSES_ROOT\lnkfile", "IsShortcut")
; 去除快捷方式字样
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer", "Link", "REG_BINARY", "0x00000000")
;关闭系统还原服务
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore', "DisableSR", "REG_DWORD", '1')
;删除共享文档目录
RunWait(@ComSpec & " /c REG DELETE HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\DelegateFolders\{59031a47-3f72-44a7-89c5-5595fe6b30ee} /f", @ScriptDir, @SW_HIDE)
;关闭系统失败写入调试信息三项
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl", "LogEven", "REG_DWORD", "0")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl", "SendAlert", "REG_DWORD", "0")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl", "AutoReboot", "REG_DWORD", "0")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl", "CrashDumpEnabled", "REG_DWORD", "0")
;禁用桌面清理向导功能
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\CleanupWiz", "NoRun", "REG_DWORD", "1")
;禁用漫游气球提示功能
RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Applets\Tour", "RunCount", "REG_DWORD", "0")
;彻底关闭系统华生医生
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug", "Auto", "REG_SZ", "0")
;禁用防火墙的提醒功能
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center", "FirewallDisableNotify", "REG_DWORD", "1")
;禁用自动更新提醒功能
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center", "UpdatesDisableNotify", "REG_DWORD", "1")
; 关闭磁盘空间不足的警告
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoLowDiskSpaceChecks", "REG_DWORD", "1")
; 关闭分组相似任务栏按钮
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarGlomming", "REG_DWORD", "0")
RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarGlomming", "REG_DWORD", "0")
; 开启启动预读,减少开机滚动条滚动次数
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters", "EnablePrefetcher", "REG_DWORD", "1")
;以下为关闭空闲IDE通道
If @OSVersion = "WIN_XP" Then
  Const $Hkey1 = "HKLM\SYSTEM\CurrentControlSet\Enum\PCIIDE\IDEChannel"
  Const $Hkey2 = "HKLM\SYSTEM\CurrentControlSet\Control\Class"
  Dim $driver = 0
  For $i = 1 To 20
   Dim $subkey1 = RegEnumKey($Hkey1, $i)
   If @error = -1 Then ExitLoop
   Dim $subkey2 = RegRead($Hkey1 & "" & $subkey1, "Driver")
   Dim $name = RegRead($Hkey2 & "" & $subkey2, "DriverDesc")
   Dim $master = RegRead($Hkey2 & "" & $subkey2, "MasterDeviceType")
   If $master = 0 Then
    RegWrite($Hkey2 & "" & $subkey2, "UserMasterDeviceType", "REG_DWORD", "3")
   ElseIf $master = 1 Then
    $driver = $driver + 1
   EndIf
   Dim $slave = RegRead($Hkey2 & "" & $subkey2, "SlaveDeviceType")
   If $slave = 0 Then
    RegWrite($Hkey2 & "" & $subkey2, "UserSlaveDeviceType", "REG_DWORD", "3")
   ElseIf $slave = 1 Then
    $driver = $driver + 1
   EndIf
  Next
EndIf
Dim $F = FileOpen(@WindowsDir & "\temp\SystemClean.cmd", 2)
;清理系统垃圾
FileWriteLine($F, 'del /s /q %windir%\*.tmp')
FileWriteLine($F, 'del /s /q %windir%\*._mp')
FileWriteLine($F, 'del /s /q %windir%\*.log')
FileWriteLine($F, 'del /s /q %windir%\*.log')
FileWriteLine($F, 'del /s /q %windir%\*.chk')
FileWriteLine($F, 'del /s /q %windir%\*.old')
FileWriteLine($F, 'del /s /q %windir%\*.bak')
FileWriteLine($F, 'del /s /q %windir%\recycled\*.*')
FileWriteLine($F, 'del /s /q %windir%\prefetch\*.*')
FileWriteLine($F, 'del /s /q "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"')
FileWriteLine($F, 'del /s /q "%USERPROFILE%\Local Settings\Temp\*.*"')
FileWriteLine($F, 'del /s /q "%USERPROFILE%\recent\*.*"')
FileWriteLine($F, 'del /s /q "%ProgramFiles%\UPDATE\*.*"')
FileWriteLine($F, 'del /s /q "%ProgramFiles%\windowsUpdate\*"')
FileWriteLine($F, 'del /s /q %windir%\RegisteredPakages\*.*')
FileWriteLine($F, 'del /s /q "%windir%\Downloaded Installations\*"')
FileWriteLine($F, 'del /s /q %windir%\softwareDistribution\download\*')
;删除Windows自带的屏幕保护程序
FileWriteLine($F, 'Chkntfs /t:0')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\scrnsave.scr')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\ss3dfo.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\ssbezier.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\ssflwbox.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\ssmarque.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\ssmypics.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\ssmyst.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\sspipes.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\ssstars.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\dllcache\sstext3d.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\scrnsave.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\ss3dfo.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\ssbezier.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\ssflwbox.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\ssmarque.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\ssmypics.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\ssmyst.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\sspipes.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\ssstars.scr"')
FileWriteLine($F, 'DEL "%systemroot%\system32\ssstars.scr"')
;删除Windows自带的墙纸(只留Bliss.BMP作为桌面)
FileWriteLine($F, 'DEL "%systemroot%\Blue Lace 16.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\Coffee Bean.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\FeatherTexture.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\Gone Fishing.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\Greenstone.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\Prairie Wind.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\Rhododendron.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\River Sumida.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\Santa Fe Stucco.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\Soap Bubbles.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\Zapotec.bmp"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Crystal.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Friend.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Home.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Moon flower.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Peace.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Power.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Purple flower.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Radiance.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Ripple.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Stonehenge.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Vortec space.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Ascent.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Autumn.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Azul.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Follow.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Red moon desert.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Tulips.jpg"')
FileWriteLine($F, 'DEL "%systemroot%\Web\Wallpaper\Wind.jpg"')
FileClose($F)
RunWait(@ComSpec & " /c call " & @WindowsDir & "\temp\SystemClean.cmd", @ScriptDir, @SW_HIDE)
RunWait(@ComSpec & " /c dir " & @WindowsDir & "\$* /a:d /b >" & @WindowsDir & "\temp\temp.log", @ScriptDir, @SW_HIDE)
RunWait(@ComSpec & " /c echo for /f %%i in (%windir%\temp\temp.log) do rd %windir%\%%i /s /q >" & @WindowsDir & "\temp\1.bat", @ScriptDir, @SW_HIDE)
RunWait(@ComSpec & " /c call " & @WindowsDir & "\temp\1.bat", @ScriptDir, @SW_HIDE)
FileDelete(@WindowsDir & "\temp\SystemClean.cmd")
FileDelete(@WindowsDir & "\temp\temp.log")
FileDelete(@WindowsDir & "\temp\1.bat")
EndFunc   ;==>_System 
发表于 2010-12-23 20:41:20 | 显示全部楼层
哇,好东西,不知道测试完整不,好些代码很实用,支持大大,辛苦了。
发表于 2011-2-4 17:52:29 | 显示全部楼层
优化不全,有很多地方没有优化到,感觉还好吧!
发表于 2011-12-12 20:45:17 | 显示全部楼层
不错,看上去,很好,试试才知道
发表于 2012-5-12 16:58:14 | 显示全部楼层
不错哦,用到了注册 表来清,加上bat 的实用性.....应该是挺全的吧
发表于 2012-5-29 21:41:32 | 显示全部楼层
支持大大,辛苦了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-2 13:26 , Processed in 0.077733 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表