温馨提示:对DOS命令和批处理不熟悉的朋友慎用! 给对脚本感兴趣的朋友送上一份完整的批处理文件(附注释) XP批处理优化程序 @echo off echo ========================= echo Windows xp 批处理优化程序 echo ========================= echo. echo ============================================================== echo Windows XP/2003优化批处理程序(主要是针对于注册表的优化和对一些 echo 系统中无用的垃圾文件的处理,以及对系统的一些服务的优化!)注意:在 echo 运行本批处理文件之前务必通读一遍整个文件的内容根据你本人需要的 echo 设置进行优化!你不需要的部分只需在前面加上"::"就行!按任意键继续 echo ============================================================== echo. pause>nul :: 删除Windows系统分区上的其它垃圾文件 ::if exist %systemroot%\Help\Tours\*.* rd /s /q %systemroot%\Help\Tours>nul ::可选删除帮助文件!如果你不想进行操作在前面加上"::"就ok了 ::删除打补丁时产生的垃圾文件 for /f "delims=" %%a in (''''dir %systemroot%\$*$ /a /b'''') do rd /q /s %systemroot%\%%a>nul ::if exist %systemroot%\ServicePackFiles\*.* rd /s /q %systemroot%\ServicePackFiles>nul ::可选删除!如果你进行了操作会引起你在装一些程序时要提示你放入ServicePack光盘.如果你不想进行操作在前面加上"::"就ok了 if exist "%systemroot%\Downloaded Installations" rd /s /q "%systemroot%\Downloaded Installations">nul if exist %systemroot%\temp\*.* del /f /q /s %systemroot%\temp\*.*>nul ::if exist %systemroot%\*.log del /f /q /s %systemroot%\*.log>nul if exist %systemroot%\*.dmp del /f /q /s %systemroot%\*.dmp>nul if exist %systemroot%\*.tmp del /f /q /s %systemroot%\*.tmp>nul if exist %systemroot%\minidump\*.* del /f /q /s %systemroot%\*.bak>nul if exist %systemroot%\minidump\*.* del /f /q /s %systemroot%\minidump\*.*>nul if exist %systemroot%\*.old del /f /q /s %systemroot%\*.old>nul if exist %systemroot%\*.query del /f /q /s %systemroot%\*.query>nul ::if exist %systemroot%\*.txt del /f /q %systemroot%\*.txt>nul if exist "%userprofile%\Recent\*.*" del /f /q /s "%userprofile%\Recent\*.*">nul if exist "%userprofile%\NetHood\*.*" del /f /q /s "%userprofile%\NetHood\*.*">nul ::if exist "%userprofile%\Local Settings\Application Data\*.*" del /f /q /s "%userprofile%\Local Settings\Application Data\*.*">nul :: 删除Windows打补丁时留下的临时文件,一般是%systemroot%目录下以$开头的目录 ::attrib -s -h -r %systemroot%\$*>nul ::if exist %systemroot%\$* rd /q /s %systemroot%\$*>nul :: 禁止设置动画效果(针对与整个windows系统) reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoChangeAnimation /t reg_dword /d 1 /f>nul :: 禁止窗口显示动画效果 reg add "HKCU\Control Panel\Desktop" /v UserPreferencesMask /t reg_binary /d 1011100 /f>nul :: 禁止最大化最小化窗口的动画效果 reg add "HKCU\Control Panel\Desktop\WindowMetrics" /v MinAnimate /d 0 /f >nul :: 禁止光驱自动播放但是保留自动播放CD reg add HKLM\system\currentControlSet\Services\Cdrom /v AutoRun /t reg_dword /d 0 /f>nul :: 减少Windows XP滚动条的次数(原值为3改为1或者5都行) reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" /v EnablePrefetcher /t REG_DWORD /d 5 /f>nul :: 加速xp的开关机时间,原值分别为20000, 20000, 12000 reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control" /v WaitToKillServiceTimeout /t REG_SZ /d 1000 /f>nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WaitToKillAppTimeout /t REG_SZ /d 1000 /f>nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v HungAppTimeout /t REG_SZ /d 200 /f>nul :: 关闭计算机时自动结束不响应的任务 reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v AutoEndTasks /t REG_SZ /d 1 /f>nul :: 关掉调试器Dr.Watson reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Auto /t REG_SZ /d 0 /f>nul :: 减少开机磁盘扫描等待时间为0秒 chkntfs /T:0 :: 在BSOD事件中禁用自动重启动 reg add HKLM\SYSTEM\CurrentControlSet\Control\CrashControl /v AutoReboot /t reg_dword /d 0 /f >nul :: 禁用桌面清理向导 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\CleanupWiz /v NoRun /t reg_dword /d 1 /f>nul :: 禁用错误报告但在发生严重错误时通知我 reg add HKLM\SOFTWARE\Microsoft\PCHealth\ErrorReporting /v DoReport /t reg_dword /d 0 /f>nul :: 禁用IMAPi光盘刻录服务 reg add HKLM\SYSTEM\CurrentControlSet\Services\ImapiService /v Start /t reg_dword /d 4 /f >nul :: 禁用Messenger服务(是为了过滤垃圾信息,不会影响到MSN Messenger或者Windows Messenger软件) reg add HKLM\SYSTEM\CurrentControlSet\Services\Messenger /v Start /t reg_dword /d 4 /f >nul :: 禁用Remote Registry 服务(远程注册表) reg add HKLM\SYSTEM\CurrentControlSet\Services\RemoteRegistry /v start /t reg_dword /d 4 /f>nul :: 禁用Windows Time 服务 reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time /v Start /t reg_dword /d 4 /f>nul :: 使用传统登录窗口 reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v LogonType /t reg_dword /d 1 /f>nul :: 把Internet Explorer可同时下载的文件数目增大到10 reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v MaxConnectionsPer1_0Server /t reg_dword /d 10 /f>nul reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v MaxConnectionsPerServer /t reg_dword /d 10 /f>nul :: 改变菜单显示延迟 reg add "HKCU\Control Panel\Desktop" /v MenuShowDelay /d 2 /f>nul :: 删除快捷方式的箭头 reg add HKCR\lnkfile /v IsShortcut /d - /f>nul :: 允许为回收站重命名 reg add HKCR\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\ShellFolder /v Attributes /t reg_binary /d 50010020 /f>nul reg add HKCR\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\ShellFolder /v CallForAttributes /t reg_dword /d 0 /f>nul :: 禁用漫游Windows XP 窗口 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Tour /v RunCount /t reg_dword /d 0 /f>nul reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Applets\Tour /v RunCount /t reg_dword /d 0 /f>nul :: 禁用磁盘剩余空间低的警告 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoLowDiskSpaceChecks /t reg_dword /d 1 /f>nul :: 删除开始菜单中的最近打开的文档菜单 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoRecentDocsmenu /t reg_dword /d 1 /f>nul :: 让隐藏“显示所有文件和文件夹”选项修改无效 reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL /v Checkedvalue /t reg_dword /d 0 /f>nul :: 个性化隐藏所有隐藏文件和系统文件(本人自行写出的一个个性化东西可以更改你想要显示的文字要做此步骤我已把备份文件放在C盘下的yang.reg) reg export HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced c:\yang.reg>nul reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced /f>nul reg add HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced\chenhui /v Bitmap /d %SystemRoot%\system32\SHELL32.dll,4 /f>nul reg add HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced\chenhui /v Text /d 警告 /f>nul reg add HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced\chenhui /v Type /d group /f>nul reg add HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced\chenhui\warning /v Checkedvalue /d "" /f>nul reg add HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced\chenhui\warning /v Defaultvalue /d "" /f>nul reg add HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced\chenhui\warning /v Text /d 这项功能已被管理员禁止了!! /f>nul reg add HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced\chenhui\warning /v Type /d group /f>nul :: 个性化隐藏自定义级别(本人自行写出的一个个性化东西可以更改你想要显示的文字要做此步骤我已把备份文件放在C盘下的chen.reg) reg export "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SO" c:\chen.reg>nul reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SO" /f>nul reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SO\chenhui" /v Bitmap /d C:\WINDOWS\system32\inetcpl.cpl,1321 /f>nul reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SO\chenhui" /v Text /d 警告!! /f>nul reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SO\chenhui" /v Type /d group /f>nul reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SO\chenhui\warning" /v Bitmap /d C:\WINDOWS\system32\inetcpl.cpl,1321 /f>nul reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SO\chenhui\warning" /v Text /d 这项功能已被管理员禁止了!! /f>nul reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\SO\chenhui\warning" /v Type /d group /f>nul :: 加快窗口显示速度 reg add "HKCU\Control Panel\Desktop\WindowMetrics" /v MinAnimate /d 1 /f>nul :: 每次启动时保持桌面设置不变 reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoSaveSettings /t reg_dword /d 0 /f>nul :: 禁用xp的防火墙 reg add "HKLM\SYSTEM\CurrentControlSet\Services\ALG" /v Start /t REG_DWORD /d 2 /f>nul reg add "HKLM\SYSTEM\CurrentControlSet\Services\Nla" /v Start /t REG_DWORD /d 2 /f>nul reg add "HKLM\SYSTEM\CurrentControlSet\Services\RasMan" /v Start /t REG_DWORD /d 2 /f>nul reg add "HKLM\SYSTEM\CurrentControlSet\Services\TapiSrv" /v Start /t REG_DWORD /d 4 /f>nul :: 禁止更改任务栏的位置 reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v Locktaskbar /t reg_dword /d 1 /f>nul :: 屏蔽"分组相似任务栏按钮" reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v taskbarGlomming /t reg_dword /d 0 /f>nul :: 禁止添加,拖,放关闭任务栏工具栏 reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoCloseDragDropBands /d 1 /f>nul :: 禁用关闭通知区域清理 reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoAutoTrayNotify /t reg_dword /d 1 /f>nul :: 隐藏任务栏的气球提示 reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v EnableBalloonTips /t reg_dword /d 0 /f>nul :: 关闭提醒气球 ::reg add add HKCU\SOFTWARE\Microsoft\Windows\NetCache\AssignedOfflineFolders /v NoReminders /t reg_dword /d 1 /f>nul :: 让xp使用传统搜索界面(这个好像不行我没有试验过我都是动手更改) reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Cabinetstate /v UseSearchAsst /d No /f>nul :: 让欢迎窗口更加清晰 reg add "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v FontSmoothingType /d 2 /f>nul reg add "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v FontSmoothing /d 2 /f>nul :: 隐藏快捷方式的小箭头(可以把/d参数后面null替换成你想要换成的图片格式必须是*.ico) reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /v 29 /d null /f>nul :: 去除xp的共享文件夹 reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\DelegateFolders\{59031a47-3f72-44a7-89c5-5595fe6b30ee}" /f>nul :: 禁止添加"快捷方式"四个字 reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer /v link /t reg_binary /d 00000000 /f>nul :: 设置系统蓝屏时自动重启 reg add HKLM\system\CurrentControlSet\Control\CrashControl /v Autoreboot /t reg_dword /d 1 /f>nul :: 让bmp自身内容作为缩略图图表显示 reg add HKCR\Paint.Picture\DefaultIcon /v "" /d %%1 /f>nul :: 禁止系统运行时默认的屏幕保护程序的运行 reg add "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v screemSaveActive /t reg_dword /d 1 /f>nul :: 增强windows核心程序的性能 reg add "HKLM\system\CurrentControlSet\Control\Session Manager\Memory Management" /v DisablePagingExecutive /t reg_dword /d 1 /f>nul :: 缩短"关闭无响应程序"等待时间(默认值为20000我建议值是2000你可以自行更改) reg add "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v WaitToKillAppTimeout /d 2000 /f>nul :: 加快打开含有大量avi文件的速度 reg delete HKCR\CLSID\{87D62D94-71B3-4b9a-9489-5FE6850DC73E} /f>nul reg add HKCR\CLSID\-{87D62D94-71B3-4b9a-9489-5FE6850DC73E} /f>nul :: 关闭"系统还原"的配置界面和系统还原的功能 reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\systemrestore" /v DisableConfig /t reg_dword /d 1 /f>nul reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\systemrestore" /v DisableSR /t reg_dword /d 1 /f>nul :: 修改应用程序出错的等待时间(默认值是5000也就是5秒我建议是3秒) reg add "HKCU\Control Panel\Desktop" /v HungAppTimeout /d 3000 /f>nul :: 取消xp的漫游功能 reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Tour /v RunCout /t reg_dword /d 1 /f>nul :: 删除文件时显示确认对话框 reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v confirmFiledelete /t reg_dword /d 1 /f>nul :: 系统出现故障时是不是要创建垃圾文件(你可以更改值当值为0时是不创建垃圾文件是1时是完完全全的把内存中的垃圾文件保存到垃圾文件中当为2时是保存最重要的文件到垃圾文件中当为3时是只将内存中64K的内容保存到垃圾文件中) reg add HKLM\system\CurrentControlSet\Control\CrashControl /v CrashDumpEnabled /d 3 /f >nul :: 指定垃圾文件的存放位置(你可以更改成你想要保存的路径和文件名就行了) reg add HKLM\system\CurrentControlSet\Control\CrashControl /v DumpFile /d %SystemRoot%\MEMORY.DMP /f>nul :: 禁止远程查找用户 reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FindExtensions\Static\WabFind /f>nul :: 屏蔽3721及其它一些垃圾网站(如果你想增加一些自己不喜欢的网站可以在下面添加) echo 127.0.0.1 http://www.3721.net/ >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 3721.com >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 3721.net >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 cnsmin.3721.com >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 cnsmin.3721.net >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 download.3721.com >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 download.3721.net >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 www.3721.com >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 www.3721.net >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 bar.baidu.com >> %systemroot%\system32\drivers\etc\hosts echo 127.0.0.1 www.unionsky.cn >> %systemroot%\system32\drivers\etc\hosts :end
|