怎样建立win7服务优化批处理.bat?

怎样建立win7服务优化批处理.bat?,第1张

@echo off

echo 服务优化正在处理,请稍等......

@echo

@pause

sc config ALG start= DEMAND

sc config AppMgmt start= DEMAND

sc config AudioEndpointBuilder start= AUTO

sc config Audiosrv start= AUTO

sc config BFE start= AUTO

sc config BITS start= AUTO

sc config Browser start= AUTO

sc config CertPropSvc start= DEMAND

sc config clr_optimization_v2.0.50727_32 start= DEMAND

sc config COMSysApp start= DEMAND

sc config CryptSvc start= AUTO

sc config DcomLaunch start= AUTO

sc config Dhcp start= AUTO

sc config Dnscache start= AUTO

sc config dot3svc start= DEMAND

sc config EapHost start= DEMAND

sc config EventSystem start= AUTO

sc config fdPHost start= DEMAND

sc config FDResPub start= DEMAND

sc config FontCache3.0.0.0 start= DEMAND

sc config gpsvc start= AUTO

sc config hidserv start= DEMAND

sc config hkmsvc start= DEMAND

sc config idsvc start= DEMAND

sc config IKEEXT start= AUTO

sc config IPBusEnum start= DEMAND

sc config KeyIso start= DEMAND

sc config LanmanServer start= AUTO

sc config LanmanWorkstation start= AUTO

sc config lltdsvc start= DEMAND

sc config lmhosts start= AUTO

sc config MMCSS start= AUTO

sc config MpsSvc start= AUTO

sc config msiserver start= DEMAND

sc config napagent start= DEMAND

sc config Netlogon start= DEMAND

sc config Netman start= DEMAND

sc config netprofm start= AUTO

sc config NetTcpPortSharing start= DISABLED

sc config NlaSvc start= AUTO

sc config NOD32krn start= AUTO

sc config nsi start= AUTO

sc config PlugPlay start= AUTO

sc config ProfSvc start= AUTO

sc config RasAuto start= DEMAND

sc config RasMan start= DEMAND

sc config RemoteAccess start= DISABLED

sc config RpcLocator start= DEMAND

sc config RpcSs start= AUTO

sc config SamSs start= AUTO

sc config SCardSvr start= DEMAND

sc config SCPolicySvc start= DEMAND

sc config SENS start= AUTO

sc config SharedAccess start= DISABLED

sc config ShellHWDetection start= AUTO

sc config slsvc start= AUTO

sc config SLUINotify start= DEMAND

sc config SNMPTRAP start= DEMAND

sc config SSDPSRV start= DEMAND

sc config SstpSvc start= DEMAND

sc config SysMain start= AUTO

sc config TapiSrv start= DEMAND

sc config TBS start= AUTO

sc config Themes start= AUTO

sc config THREADORDER start= DEMAND

sc config TrustedInstaller start= DEMAND

sc config upnphost start= DEMAND

sc config UxSms start= AUTO

sc config vds start= DEMAND

sc config W32Time start= AUTO

sc config wcncsvc start= DEMAND

sc config WcsPlugInService start= DEMAND

sc config WinHttpAutoProxySvc start= DEMAND

sc config Winmgmt start= AUTO

sc config Wlansvc start= DEMAND

sc config wmiApSrv start= DEMAND

sc config WMPNetworkSvc start= DEMAND

sc config wscsvc start= AUTO

sc config wuauserv start= AUTO

sc config wudfsvc start= DEMAND

@pause

echo.

echo.&echo 优化完成!任意键退出

echo. &pause>nul

把上面一段复制到记事本中保存为.bat文件即可

很多人都会抱怨电脑越用越慢,其实这是因为你不懂得优化系统,那么Win7系统如何进行优化呢?接下来大家跟着我一起来了解一下Win7系统进行优化的解决 方法 吧。

Win7系统进行优化方法一

1、在Windows7系统默认设置下是使用一个处理器启动(即时使用单核棚毁启动),现在市面上多数的电脑都是多核处理器,众所谓人多力量大,处理器也是一样的!启动的内核数量增加后,开机速度自然提升!

下面为大家来介绍一下增加启动的内核数量设置方法:

打开开始菜单在搜索程序框中输入“msconfig”命令,打开系统配置窗口后找到卜汪“引导”选项(英文系统是Boot)。

 

2、Win7拥有强大便捷的搜索栏,记住一些常用命令,可以让 *** 作起来更快捷。

点击“高级选项”此时就可以看到我们将要修改的设置项了。

高级选项

勾选“处理器数”和“最大内存”,看到电脑可选项中有多大你就可以选多大,这里所用电脑最大就支持将处理器调整到2,可能你的机器会更高(处理器数目通常是2,4,8),同时调大内存,确定后重启电脑生效,此时再看看系统启动时间是不是加快了。如果想要确切知道节省的时间,可以先记录下之前开机时所用时间做详细比较。

 

Win7系统进行优化方法二

加快Windows 7系统关机速度

在Windows 7系统的开始型和仔菜单处的搜索框中输入“regedit”打开注册表编辑器

   

2接下找到HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control一项打开,可以发现其中有一项“WaitToKillServiceTimeOut”,鼠标右键点击修改可以看到Windows 7默认数值是12000(代表12秒),这里可以把这个数值适当修改低一些,比如5秒或是7秒。

你没说是什么系统,我就给你一个Windows7系统的代码好了:

==========================================

mode con cols=40 lines=20

title win7终极批处理

@echo off

color 3f

:main

cls

echo.

echo┌──────────┐

echo丨 win7 终极批处理 丨

echo丨====================丨

echo丨 制作: 何 苦 丨

echo└──────────┘

echo.

echo 1 - 清理win7系统垃圾

echo 2 - 修复打开图片缓慢

echo 3 - 重启explorer进程

echo 4 - 定时关机/取消关机

echo 5 - 清除任务栏伍悔橡历史图标

echo 6 - 去掉快捷方式小箭头

echo 7 - 恢复快捷方式小箭头

echo 8 - 备前或份/优化系统服务

echo 9 - 清除图片位置冗余文件夹

echo 0 - 退出

echo.

echo ※直接回车可查看说明文档※

echo.

set choice=

set /p choice=请输入[序号+回车]:

if /i '%choice%'=='1' goto main1

if /i '%choice%'=='2' goto main2

if /i '%choice%'=='3' goto main3

if /i '%choice%'=='4' goto main4

if /i '%choice%'=='5' goto main5

if /i '%choice%'=='6' goto main6

if /i '%choice%'=='7' goto main7

if /i '%choice%'=='8' goto main8

if /i '%choice%'=='9' goto main9

if /i '%choice%'=='0' goto end

cls

echo 您好!感谢使用[win7终级批处理].本工具

echo 默认win7系统安装在C盘下.如果win7非安装

echo 在C盘下.部分功能无效.

echo.

echo 本工具可以常规清理系统垃圾.修复因用户进

echo 行过校准颜色而使打开图片缓慢.清除任务栏

echo 托盘里的历史图标.清除桌面背景\图片位置

echo 里用户自定义的文件夹.去除快捷方式小箭头

echo 恢复小箭头(无法将图标附到任务栏和开始

echo 菜单等问题也可用此修复).备份及优化系统

echo 服务.批处理中有些功能要修改注册表,如有

echo 软件拦截,请放行.

echo.

echo 所有功能均在作者机子上测试通过,但由于不

echo 定因素,不能保证所有用户都能正常使用!如

echo 果出现问题,请恕作者不负任何责任!

echo.

echo ※交流邮箱:heku@sina.cn※

echo.

pause

goto main

:end

exit

:main1

cls

echo 正在清理系统盘中的垃圾文件...

del /f /s /q %systemdrive%\*.log 2>nul

del /f /s /q %systemdrive%\*.bak 2>nul

del /f /s /q %systemdrive%\*.chk 2>nul

del /f /s /q %systemdrive%\*.tmp 2>nul

del /f /s /q %systemdrive%\*._mp 2>nul

del /f /s /q %systemdrive%\*.ftg 2>nul

del /f /s /q %systemdrive%\*.gid 2>nul

del /f /s /q %systemdrive%\*.pnf 2>nul

del /f /s /q %systemdrive%\thumbs.db 2>nul

rd /s /q %windir%\temp md %windir%\temp 2>nul

del /腔旁f /s /q %systemdrive%\recycled\*.* 2>nul

del /f /s /q %windir%\prefetch\*.* 2>nul

del /f /q %userprofile%\AppData\Roaming\Microsoft\Windows\Cookies\*.* 2>nul

del /f /s /q "%userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*" 2>nul

cls

d:

cd\

echo 正在清理其他盘中的垃圾文件...

del /f /s /q *.log 2>nul

del /f /s /q *.tmp 2>nul

del /f /s /q thumbs.db 2>nul

e:

cd\

del /f /s /q *.log 2>nul

del /f /s /q *.tmp 2>nul

del /f /s /q thumbs.db 2>nul

f:

cd\

del /f /s /q *.log 2>nul

del /f /s /q *.tmp 2>nul

del /f /s /q thumbs.db 2>nul

g:

cd\

del /f /s /q *.log 2>nul

del /f /s /q *.tmp 2>nul

del /f /s /q thumbs.db 2>nul

goto main

:main2

cls

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo 正在修复,请稍等...

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

del %windir%\system32\spool\drivers\color\CalibratedDisplayProfile-?.icc >nul 2>nul

ping localhost -n 3 >nul 2>nul

goto main

:main3

cls

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo explorer进程重启中,请勿关闭程序...

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

taskkill /f /im Explorer.exe >nul 2>nul

ping localhost -n 3 >nul 2>nul

start "explorer.exe" "%windir%\explorer.exe"

goto main

:main4

cls

set hour=%time:~0,2%

set min=%time:~3,2%

echo ┌————————————————┐

echo 丨丨

echo 丨%date% %hour%时%min%分丨

echo 丨丨

echo └———————————————─┘

echo.

echo.

echo.

echo.

echo ===========================

echo1 - 定时关机

echo2 - 取消关机

echo0 - 退出

echo ===========================

echo.

echo.

echo ※直接回车可查看说明文档※

echo.

echo.

set ver0=

set /p ver0=请输入[序号+回车]:

if /i "%ver0%"=="1" goto powerdown

if /i "%ver0%"=="2" goto giveup

if /i "%ver0%"=="0" goto exitd

cls

echo.

echo.

echo 如果要在21:30关机,输入格式:

echo.

echo 请输入时:21

echo 请输入分:30

echo.

echo.

echo 请正确输入时间,否则可能不能成功执行!

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

pause

goto main4

:exitd

goto main

:powerdown

cls

echo ┌————————————————┐

echo 丨丨

echo 丨%date% %hour%时%min%分丨

echo 丨丨

echo └———————————————─┘

echo.

echo.

echo.

echo [24时制]

set /p time1=请输入时:

set /p time2=请输入分:

echo.

if /i "%time1%"=="" goto powerdown

if /i "%time2%"=="" goto powerdown

at %time1%:%time2% shutdown -s -t 0 >nul

echo.

echo 您的电脑将在%time1%:%time2%时刻关闭

echo.

echo 在关机之前,您可以随时取消关机计划

echo.

echo.

echo.

pause

goto main

:giveup

cls

at /del /yes

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo关机计划已经取消,按任意键返回...

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

pause >nul

goto main

:main5

reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams /f

reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream /f

goto main3

:main6

copy Empty.ico %systemdrive%\windows >nul

@echo Windows Registry Editor Version 5.00>>D:\tmp.reg

@echo [HKEY_CLASSES_ROOT\piffile]>>D:\tmp.reg

@echo "IsShortcut"="">>D:\tmp.reg

@echo [HKEY_CLASSES_ROOT\lnkfile]>>D:\tmp.reg

@echo "IsShortcut"="">>D:\tmp.reg

@echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons]>>D:\tmp.reg

@echo "29"="C:\\Windows\\Empty.ico,0">>D:\tmp.reg

regedit/s D:\tmp.reg

del D:\tmp.reg

goto main3

:main7

@echo Windows Registry Editor Version 5.00>>D:\tmp.reg

@echo [HKEY_CLASSES_ROOT\piffile]>>D:\tmp.reg

@echo "IsShortcut"="">>D:\tmp.reg

@echo [HKEY_CLASSES_ROOT\lnkfile]>>D:\tmp.reg

@echo "IsShortcut"="">>D:\tmp.reg

@echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons]>>D:\tmp.reg

regedit/s D:\tmp.reg

del D:\tmp.reg

del %windir%\Empty.ico

goto main3

:main8

cls

echo.

echo.

echo.

echo ===========================

echo1 - 备份服务

echo.

echo2 - 优化服务

echo.

echo0 - 退出

echo ===========================

echo.

echo.

echo.

echo建议在优化之前先做备份

echo.

echo.

echo.

echo.

echo.

set ver1=

set /p ver1=请输入[序号+回车]:

if /i "%ver1%"=="1" goto bfser

if /i "%ver1%"=="2" goto yhser

if /i "%ver1%"=="0" goto exitser

:exitser

goto main

:bfser

cls

echo.

echo 正在备份服务,如果优化出了问题您可以及时

echo 恢复.备份会生成一个以当前时间命名的批处

echo 理文件,恢复时只要双击即可.

rem get current date and time

for /f "tokens=1, 2, 3, 4 delims=-/. " %%j in ('Date /T') do set FILENAME=srv_%%j_%%k_%%l_%%m

for /f "tokens=1, 2 delims=: " %%j in ('TIME /T') do set FILENAME=%FILENAME%_%%j_%%k.bat

rem get all service name

sc query type= service state= all| findstr /r /C:"SERVICE_NAME:" >tmpsrv.txt

echo.

echo.

echo.

echo 正在备份,请稍等...

echo.

echo.

echo.

echo.

echo.

echo.

echo.

rem save service start state into batch file

echo @echo Restore The Service Start State Saved At %TIME% %DATE% >"%FILENAME%"

echo @pause >>"%FILENAME%"

for /f "tokens=2 delims=:" %%j in (tmpsrv.txt) do @( sc qc %%j |findstr START_TYPE >tmpstype.txt && for /f "tokens=4 delims=:_ " %%s in ( tmpstype.txt) do @echo sc config %%j start= %%s >>"%FILENAME%")

echo @pause >>"%FILENAME%"

del tmpsrv.txt

del tmpstype.txt

echo 服务已备份到:

echo %FILENAME%

echo.

echo 按任意键返回...&pause >nul

goto main8

:yhser

cls

sc config AxInstSV= demand

sc config ALG start= demand

sc config AppMgmt start= demand

sc config AudioEndpointBuilder start= auto

sc config Audiosrv start= auto

sc config BFE start= auto

sc config BITS start= demand

sc config Browser start= demand

sc config CertPropSvc start= demand

sc config clr_optimization_v2.0.50727_32 start= demand

sc config COMSysApp start= demand

sc config CryptSvc start= auto

sc config DcomLaunch start= auto

sc config Dhcp start= auto

sc config Dnscache start= auto

sc config dot3svc start= demand

sc config EapHost start= demand

sc config EventSystem start= auto

sc config fdPHost start= demand

sc config FDResPub start= demand

sc config FontCache3.0.0.0 start= demand

sc config gpsvc start= auto

sc config hidserv start= demand

sc config hkmsvc start= demand

sc config idsvc start= demand

sc config IKEEXT start= demand

sc config IPBusEnum start= demand

sc config KeyIso start= demand

sc config LanmanServer start= auto

sc config LanmanWorkstation start= auto

sc config lltdsvc start= demand

sc config lmhosts start= auto

sc config MMCSS start= auto

sc config MpsSvc start= auto

sc config msiserver start= demand

sc config napagent start= demand

sc config Netlogon start= demand

sc config Netman start= demand

sc config netprofm start= auto

sc config NetTcpPortSharing start= disabled

sc config NlaSvc start= auto

sc config nsi start= auto

sc config PlugPlay start= auto

sc config ProfSvc start= auto

sc config RasAuto start= demand

sc config RasMan start= demand

sc config RemoteAccess start= disabled

sc config RpcLocator start= demand

sc config RpcSs start= auto

sc config SamSs start= auto

sc config SCardSvr start= demand

sc config SCPolicySvc start= demand

sc config SENS start= auto

sc config SharedAccess start= disabled

sc config SNMPTRAP start= demand

sc config SSDPSRV start= demand

sc config SstpSvc start= demand

sc config SysMain start= auto

sc config TapiSrv start= demand

sc config TBS start= demand

sc config Themes start= auto

sc config THREADORDER start= demand

sc config TrustedInstaller start= demand

sc config upnphost start= demand

sc config UxSms start= auto

sc config vds start= demand

sc config W32Time start= demand

sc config wcncsvc start= demand

sc config WcsPlugInService start= demand

sc config WinHttpAutoProxySvc start= demand

sc config Winmgmt start= auto

sc config Wlansvc start= demand

sc config wmiApSrv start= demand

sc config WMPNetworkSvc start= demand

sc config wscsvc start= auto

sc config wuauserv start= demand

sc config wudfsvc start= demand

sc config WinDefend start= demand

goto main8

:main9

cls

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo 正在清理,请稍等...

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo.

echo Windows Registry Editor Version 5.00>>d:\tmp.reg

echo [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers\Images]>>d:\tmp.reg

echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers\Images]>>d:\tmp.reg

regedit /s d:\tmp.reg

del d:\tmp.reg

ping localhost -n 3 >nul 2>nul

goto main


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/12391711.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存