查看: 3003|回复: 4
收起左侧

[求助] 系统优化小工具 批处理文件(转自由天空)

[复制链接]
xp163
发表于 2011-6-25 20:51:08 | 显示全部楼层 |阅读模式
                       系统优化小工具 批处理文件(转自由天空)

系统优化小工具 批处理文件(转自由天空)

     2010/01/22 09:53

@shift 1
@echo off
color 0a
title 系统优化
:menu
cls

echo 功能清单:
echo.
echo [0] 全自动完成以下项目
echo [1] 系统服务优化
echo [2] XP瘦身处理
echo [3] 清除系统垃圾文件
echo [4] 删除系统默认共享
echo [5] 修改IDE通道设备检测模式
echo [6] 禁止保留文档记录
echo.
echo [Q] 退出系统
echo.
echo ---------------------------------------
set /p mainmenu=请选择优化方式[0/1/2/3/4/5/6/q]?
if /I "%mainmenu%"=="0" goto :m_fw
if /I "%mainmenu%"=="1" goto :m_fw
if /I "%mainmenu%"=="2" goto :m_ss
if /I "%mainmenu%"=="3" goto :m_lj
if /I "%mainmenu%"=="4" goto :m_gx
if /I "%mainmenu%"=="5" goto :m_ide
if /I "%mainmenu%"=="6" goto :m_wd
if /I "%mainmenu%"=="q" exit

goto :menu

:m_fw
echo.
echo ---------------------------------------
echo 开始系统服务优化
echo ---------------------------------------
:: Print Spooler 设置为:已停用 (打印机 需要)
:item_printer
set /p printer=本机是否连接了打印机[是:Y 否:N]?
if /I "%printer%"=="y" (
SC config spooler start= auto>nul
goto :item_Wireless
)
if /I "%printer%"=="n" (
SC config spooler start= disabled>nul
goto :item_Wireless
)
echo.
echo 请输入Y/N !
goto :item_printer

:: Wireless Zero Configuration 设置为:手动
:item_Wireless
set /p havewireless=本机是否使用无线网卡[是:Y 否:N]?
if /I "%havewireless%"=="y" (
SC config wzcsvc start= auto>nul
goto :item_othersrv
)
if /I "%havewireless%"=="n" (
SC config wzcsvc start= disabled>nul
goto :item_othersrv
)
echo.
echo 请输入Y/N !
goto :item_Wireless

:item_othersrv
:: Alerter 设置为:已停用
SC config Alerter start= disabled>nul

:: Application Layer Gateway Service 设置为:已停用
SC config ALG start= disabled>nul

:: Application Management 设置为:手动
SC config APPMGMT start= demand>nul
echo [▓------------------------------]

:: Automatic Updates 设置为:手动 (系统升级需要)
SC config wuauserv start= demand>nul

:: Background Intelligent Transfer Service 设置为:手动 (系统升级需要)
sc config BITS start= demand>nul

:: ClipBook 设置为:已停用
sc config ClipSRV start= disabled>nul

:: COM+ Event System 设置为:手动/已停用(c:\program files\ComPlus Applications 目录无内容 即可关闭)
SC config EventSystem start= disabled>nul

:: COM+ System Application 设置为:手动/已停用 (同上)
SC config COMSYSAPP start= disabled>nul
echo [▓▓----------------------------]

:: Computer Browser 设置为:已停用
SC config Browser start= disabled>nul

:: Cryptographic Services 设置为:手动 (WMP、DirectX、系统升级需要)
SC config CryptSvc start= demand>nul

:: DCOM Server Process Launcher 设置为:自动
SC config DCOMlaunch start= auto>nul

:: DHCP Client 设置为:自动
SC config DHCP start= auto>nul

:: Distributed Link Tracking Client 设置为:已停用
SC config trkwks start= disabled>nul
echo [▓▓▓--------------------------]

:: Distributed Transaction Coordinator 设置为:已停用
SC config MSDTC start= disabled>nul

:: DNS Client 设置为:自动
SC config DNSCACHE start= auto>nul

:: Error Reporting Service 设置为:已停用
SC config ERSVC start= disabled>nul

:: Event Log 设置为:自动
SC config EVENTLOG start= auto>nul

:: Fast User Switching Compatibility 设置为:已停用
SC config FastUserSwitchingCompatibility start= disabled>nul
echo [▓▓▓▓------------------------]

:: HTTP SSL 设置为:手动
SC config HTTPFILTER start= demand>nul

:: Human Interface Device Access 设置为:已停用
SC config hidserv start= disabled>nul

:: IMAPI CD-Burning COM Servic 设置为:已停用
SC config IMAPISERVICE start= disabled>nul

:: Indexing Service 设置为:已停用
SC config CISVC start= disabled>nul

:: IPSEC Services 设置为:已停用
SC config POLICYAGENT start= disabled>nul
echo [▓▓▓▓▓----------------------]

:: Logical Disk Manager 设置为:手动
SC config dmserver start= demand>nul

:: Logical Disk Manager Administrative Service 设置为:手动
SC config dmadmin start= demand>nul

:: Messenger 设置为:已停用
SC config messenger start= disabled>nul

:: MS Software Shadow Copy Provider 设置为:已停用
SC config swprv start= disabled>nul

:: Net Logon 设置为:已停用
SC config NetLogon start= disabled>nul
echo [▓▓▓▓▓▓--------------------]

:: NetMeeting Remote Desktop Sharing 设置为:已停用
SC config mnmsrvc start= disabled>nul

:: Network Connections 设置为:手动
SC config netman start= demand>nul

:: Network DDE 设置为:已停用
SC config netdde start= disabled>nul

:: Network DDE DSDM 设置为:已停用
SC config netddedsdm start= disabled>nul

:: Network Location Awareness (NLA) 设置为:已停用
SC config nla start= disabled>nul
echo [▓▓▓▓▓▓▓------------------]

:: Network Provisioning Service 设置为:手动
SC config xmlprov start= demand>nul

:: NT LM Security Support Provider 设置为:已停用
SC config ntlmssp start= disabled>nul

:: Performance Logs and Alerts 设置为:已停用
SC config sysmonlog start= disabled>nul

:: Plug and Play 设置为:自动 (外设需要,必须保留)
SC config plugplay start= auto>nul

:: Portable Media Serial Number Service 设置为:已停用
SC config wmdmpmsn start= disabled>nul
echo [▓▓▓▓▓▓▓▓----------------]

:: Protected Storage 设置为:自动
SC config ProtectedStorage start= auto>nul

:: QoS RSVP 设置为:已停用
SC config rsvp start= disabled>nul

:: Remote Access Auto Connection Manager 设置为:手动
SC config rasauto start= demand>nul

:: Remote Access Connection Manager 设置为:手动
SC config rasman start= demand>nul

:: Remote Desktop Help Session Manager 设置为:已停用
SC config rdsessmgr start= disabled>nul
echo [▓▓▓▓▓▓▓▓▓--------------]

:: Remote Procedure Call (RPC) 设置为:自动
SC config rpcss start= auto>nul

:: Remote Procedure Call (RPC) Locator 设置为:已停用
SC config RPCLocator start= disabled>nul

:: Remote Registry 设置为:已停用
SC config RemoteRegistry start= disabled>nul

:: Removable Storage 设置为:已停用
SC config ntmssvc start= disabled>nul

:: Routing and Remote Access 设置为:已停用
SC config RemoteAccess start= disabled>nul
echo [▓▓▓▓▓▓▓▓▓▓------------]

:: Secondary Logon 设置为:已停用
SC config SecLogon start= disabled>nul

:: Security Accounts Manager 设置为:自动
SC config samss start= auto>nul

:: Security Center 设置为:已停用
SC config wscsvc start= disabled>nul

:: Server 设置为:已停用(局域网朋友注意:这个停用将不能共享文件!但不影响共享上网)
SC config lanmanserver start= auto>nul

:: Shell Hardware Detection 设置为:已停用
SC config ShellHwDetection start= disabled>nul
echo [▓▓▓▓▓▓▓▓▓▓▓----------]

:: Smart Card 设置为:已停用
SC config scardsvr start= disabled>nul

:: SSDP Discovery Service 设置为:已停用
SC config ssdpsrv start= disabled>nul

:: System Event Notification 设置为:手动 (系统升级需要)
SC config sens start= demand>nul

:: System Restore Service 设置为:已停用
SC config srservice start= disabled>nul

:: Task Scheduler 设置为:已停用
SC config Schedule start= disabled>nul
echo [▓▓▓▓▓▓▓▓▓▓▓▓--------]

:: TCP/IP NetBIOS Helper 设置为:已停用
SC config lmhosts start= disabled>nul

:: Telephony 设置为:手动
SC config tapisrv start= demand>nul

:: Telnet 设置为:已停用
SC config tlntsvr start= disabled>nul

:: Terminal Services 设置为:已停用
SC config termservice start= disabled>nul

:: Themes 设置为:已停用 (主题服务)
SC config themes start= auto>nul
echo [▓▓▓▓▓▓▓▓▓▓▓▓▓------]

:: Uninterruptible Power Supply 设置为:已停用
SC config ups start= disabled>nul

:: Universal Plug and Play Device Host 设置为:已停用
SC config upnphost start= disabled>nul

:: Volume Shadow Copy 设置为:已停用
SC config vss start= disabled>nul

:: WebClient 设置为:已停用
SC config WebClient start= disabled>nul

:: Windows Audio 设置为:自动
SC config Audiosrv start= auto>nul
echo [▓▓▓▓▓▓▓▓▓▓▓▓▓▓----]

:: Windows Firewall/Internet Connection Sharing (ICS) 设置为:已停用
SC config sharedaccess start= disabled>nul

:: Windows Image Acquisition (WIA) 设置为:手动 (扫描仪、数字相机、摄像头 需要)
SC config stisvc start= demand>nul

:: Windows Installer 设置为:手动
SC config msiserver start= demand>nul

:: Windows Management Instrumentation (WMI) 设置为:手动
SC config winmgmt start= demand>nul

:: Windows Management Instrumentation Driver Extensions 设置为:手动
SC config wmi start= demand>nul
echo [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓--]

:: Windows Time 设置为:已停用
SC config w32time start= disabled>nul

:: WMI Performance Adapter 设置为:已停用
SC config wmiapsrv start= disabled>nul

:: Workstation 设置为:自动
SC config lanmanworkstation start= auto>nul
echo [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓]
echo ---------------------------------------
echo 系统服务优化完毕!
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
if /I "%mainmenu%"=="1" goto :menu


:m_ss
echo.
echo ---------------------------------------
echo 开始XP瘦身处理
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
echo.开始处理程序...
echo.1.删除系统文件备份...
SFC.EXE /PURGECACHE
echo 完毕!!!
echo ---------------------------------------
echo.2.删除WINDOWS驱动备份文件...
del /f /s /q %windir%\DRIVER CACHE\I386\DRIVER.CAB
echo 完毕!!!
echo ---------------------------------------
echo.3.删除帮助文件...
rd /s /q %windir%\HELP & md %windir%\HELP
echo 完毕!!!
echo ---------------------------------------
echo.4.删除备用的DLL文件...
del /f /s /q %windir%\SYSTEM32\DLLCACHE\*.*
echo 完毕!!!
echo ---------------------------------------
echo XP瘦身处理完毕!
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
if /I "%mainmenu%"=="2" goto :menu


:m_lj
echo.
echo ---------------------------------------
echo 开始清除系统垃圾文件
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
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%\prefetch\
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo ---------------------------------------
echo 清除系统垃圾完毕!
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
if /I "%mainmenu%"=="3" goto :menu

:m_gx
echo.
echo ---------------------------------------
echo 删除系统默认共享
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
echo.
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do @(
if exist %%a:\nul (
net share %%a$ /delete>nul 2>nul && echo 成功删除名为 %%a$ 的默认共享 || echo 名为 %%a$ 的默认共享不存在
)
)
net share admin$ /delete>nul 2>nul && echo 成功删除名为 admin$ 的默认共享 || echo 名为 admin$ 的默认共享不存在
echo.
echo 正在重启Server服务...
net stop Server>nul 2>nul && echo Server服务已停止
net start Server>nul 2>nul && echo Server服务已启动
echo OK!
echo 修改注册表以更改系统默认设置...
echo 正在创建注册表文件...
echo Windows Registry Editor Version 5.00> c:\delshare.reg
:: 通过注册表禁止Admin$共享,以防重启后再次加载
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]>> c:\delshare.reg
echo "AutoShareWks"=dword:00000000>> c:\delshare.reg
echo "AutoShareServer"=dword:00000000>> c:\delshare.reg
:: 删除IPC$共享,本功能需要administritor权限才能成功删除
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]>> c:\delshare.reg
echo "restrictanonymous"=dword:00000001>> c:\delshare.reg
echo 正在导入注册表文件以更改系统默认设置.
regedit /s c:\delshare.reg
del c:\delshare.reg && echo 临时文件已经删除.
echo.
echo ---------------------------------------
echo 删除系统默认共享完毕!
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
if /I "%mainmenu%"=="4" goto :menu

:m_ide
echo.
echo ---------------------------------------
echo 修改IDE通道设备检测模式
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
:: 修改IDE通道检测设备模式,不接设备的设置为无,提高XP启动速度
:: 建议在系统第二次重新启动检测到所有已经安装的IDE设备后运行
@set _debug=
@echo %_debug% off & setlocal ENABLEDELAYEDEXPANSION
set hkey1=HKLM\SYSTEM\CurrentControlSet\Enum\PCIIDE\IDEChannel
set hkey2=HKLM\SYSTEM\CurrentControlSet\Control\Class
for /f "usebackq tokens=*" %%I in (`reg query %hkey1% ^| find /i "IDEChannel\"`) do call :_check "%%I"
goto :ide_end

:_check
::echo %1
set subkey=
for /f "usebackq tokens=3*" %%J in (`reg query %1 ^| find /i "driver"`) do set subkey=%%J
set DriverDesc=
for /f "usebackq tokens=3,4*" %%K in (`reg query "%hkey2%\%subkey%" /v DriverDesc ^| find /i "driverdesc"`) do set DriverDesc=%%K %%L 通道
reg query "%hkey2%\%subkey%" /v MasterDeviceType | find /i "0x1" > nul
if %errorlevel%==1 goto _ChgMaster
goto _CheckSlave

:_ChgMaster
reg add "%hkey2%\%subkey%" /v UserMasterDeviceType /t REG_DWORD /d 3 /f
echo "%DriverDesc%"的设备0检测方式设置为无。

:_CheckSlave
reg query "%hkey2%\%subkey%" /v SlaveDeviceType | find /i "0x1" > nul
if %errorlevel%==1 goto _ChgSlave
goto :eof

:_ChgSlave
reg add "%hkey2%\%subkey%" /v UserSlaveDeviceType /t REG_DWORD /d 3 /f
echo "%DriverDesc%"的设备1检测方式设置为无。
goto :eof

:ide_end
echo.
echo ---------------------------------------
echo 修改IDE通道设备检测模式完毕!
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
if /I "%mainmenu%"=="5" goto :menu

:m_wd
echo.
echo ---------------------------------------
echo 禁止保留文档记录
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /V NORECENTDOCSHISTORY /T REG_DWORD /D 1 /F
echo ---------------------------------------
echo 禁止保留文档记录完毕!
echo ---------------------------------------
if /I not "%mainmenu%"=="0" echo. & pause
if /I "%mainmenu%"=="6" goto :menu

::所有子功能完毕==========================================================================================
if /I "%mainmenu%"=="0" (
echo 全自动系统优化完毕!
echo ---------------------------------------
echo. & pause
goto :menu
)
CKCANADA
发表于 2011-6-26 00:54:10 | 显示全部楼层
wow,大而全,幾乎市面上一些優化軟件所涉及的所謂優化功能都有了,這個不錯,爽呆呆了,謝謝樓主分享
1109059127
发表于 2011-6-26 08:29:38 | 显示全部楼层
我还是用软件 优化 安逸!
angol
发表于 2011-6-26 16:56:26 | 显示全部楼层
这个批处理是哪里做封装的或者定制系统  自己使用的电脑没什么必要使用
lb0536
发表于 2011-6-26 17:28:50 | 显示全部楼层
没法看!!!
您需要登录后才可以回帖 登录 | 快速注册

本版积分规则

手机版|杀毒软件|软件论坛| 卡饭论坛

Copyright © KaFan  KaFan.cn All Rights Reserved.

Powered by Discuz! X3.4( 沪ICP备2020031077号-2 ) GMT+8, 2025-1-16 16:53 , Processed in 0.133572 second(s), 16 queries .

卡饭网所发布的一切软件、样本、工具、文章等仅限用于学习和研究,不得将上述内容用于商业或者其他非法用途,否则产生的一切后果自负,本站信息来自网络,版权争议问题与本站无关,您必须在下载后的24小时之内从您的电脑中彻底删除上述信息,如有问题请通过邮件与我们联系。

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