谁给我写个史上最完整的电脑优化BAT!

谁给我写个史上最完整的电脑优化BAT!,第1张

@ ECHO.

@ ECHO.

@ ECHO. 说 明

@ ECHO --------------------------------------------------------------------------

@ ECHO IDE通道在这里看:设备管理器---IDE ATA/ATAPI控制器。一般可看到两个或多个。

@ ECHO 其属性内的“设备类型”,系统如饥默认是“自动检测”,把它设为“无”可以提高

@ ECHO 开机速度。但如果以后要接硬盘或光驱,请记得把相应的通道改为“自动检测”,

@ ECHO 否则进改橡缺系统后看不到它们。

@ ECHO --------------------------------------------------------------------------

@ ECHO.

::::::::::::::::::::::::::::::::::::常用环境变量:::::::::::::::::::::::::::::::::::::::::::

:: ALLUSERSPROFILE=C:\Documents and Settings\All Users

:: APPDATA=C:\Documents and Settings\Administrator\Application Data

::::::::::::::::::::::::::::::批处理提示完成等信息的方法:::::::::::::::::::::::::::::::::::

:: echo intAnswer=Msgbox("1.***"核辩 ^&vbNewLine ^&"" ^&vbNewLine ^&"2.***", ok, "提示:")>"%TEMP%\inform.vbs"

:: attrib +H "%TEMP%\inform.vbs"

:: "%TEMP%\inform.vbs"

:: del /a /f "%TEMP%\inform.vbs"

::::::::::::::::::::::::::::::::::创建快捷方式的方法:::::::::::::::::::::::::::::::::::::::

:: sPath代表批处理所运行的位置,待创快捷方式程序与批处理在同目录,否则要修改sPath后的路径::

:: 如用%sPath%文件夹名称\,若用Programs替换Desktop ,则在“开始--所有程序”中创建快捷方式::

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: set sPath=%~dp0

:: echo On Error Resume Next>"%TEMP%\createcs.vbs"

:: echo attrib +H "%TEMP%\createcs.vbs"

:: echo Set Shell=CreateObject("WScript.Shell")>>"%TEMP%\createcs.vbs"

:: echo CsPath=Shell.SpecialFolders("Desktop")>>"%TEMP%\createcs.vbs"

:: echo Set link=Shell.CreateShortcut(CsPath ^&"\\程序名称.lnk")>>"%TEMP%\createcs.vbs"

:: echo link.description="位置:"^&"%sPath%">>"%TEMP%\createcs.vbs"

:: echo link.TargetPath="%sPath%程序名称.exe">>"%TEMP%\createcs.vbs"

:: echo link.WindowStyle=1 >>"%TEMP%\createcs.vbs"

:: echo link.WorkingDirectory=CsPath>>"%TEMP%\createcs.vbs"

:: echo link.Save>>"%TEMP%\createcs.vbs"

:: echo Set link2=Shell.CreateShortcut(CsPath ^&"\\程序名称2.lnk")>>"%TEMP%\createcs.vbs"

:: echo link2.description="位置:"^&"%sPath%">>"%TEMP%\createcs.vbs"

:: echo link2.TargetPath="%sPath%程序名称2.exe">>"%TEMP%\createcs.vbs"

:: echo link2.WindowStyle=1 >>"%TEMP%\createcs.vbs"

:: echo link2.WorkingDirectory=CsPath>>"%TEMP%\createcs.vbs"

:: echo link2.Save>>"%TEMP%\createcs.vbs"

:: "%TEMP%\createcs.vbs"

:: del /a /f "%TEMP%\createcs.vbs"

:::::::::::::::::::::::::注册批处理所在目录及其所有子目录下DLL的方法::::::::::::::::::::::

:: if exist "%SystemDrive%\RegKJ.tmp" del /q "%SystemDrive%\RegKJ.tmp"

:: dir /s /b "*.dll">>"%SystemDrive%\RegKJ.tmp"

:: dir /s /b "*.ocx">>"%SystemDrive%\RegKJ.tmp"

:: for /f "delims=*" %%i in (%SystemDrive%\RegKJ.tmp) do Regsvr32 /s "%%i"

:: del /q "%SystemDrive%\RegKJ.tmp"

::::::::::::::::::::::::::用批处理安装字体的方法-.\指批处理所在目录:::::::::::::::::::::::

:: REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL" /V "CheckedValue" /T "REG_DWORD" /D "1" /F>NUL

:: IF NOT EXIST "%SystemRoot%\FONTS\DESKTOP.INI" ECHO [.ShellClassInfo]>"%SystemRoot%\FONTS\DESKTOP.INI" &&ECHO UICLSID={BD84B380-8CA2-1069-AB1D-08000948F534}>>"%SystemRoot%\FONTS\DESKTOP.INI"

:: ATTRIB +H +R "%SystemRoot%\FONTS\DESKTOP.INI"

:: ATTRIB +H +R "%SystemRoot%\FONTS"

:: copy /Y .\字体所在目录名称\*.ttf "%SystemRoot%\fonts\"

:: start explorer "%SystemRoot%\fonts\"

:: echo set WshShell=createobject("wscript.shell")>"%temp%\$tep$.vbs"

:: attrib +H "%temp%\$tep$.vbs"

:: echo WshShell.AppActivate "FONTS">>"%temp%\$tep$.vbs"

:: echo WshShell.sendkeys "%%{f4}">>"%temp%\$tep$.vbs"

:: "%temp%\$tep$.vbs"

:: del /a /f "%temp%\$tep$.vbs"

:::::::::::::::::::::::::::::::::::开始执行代码::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::路径解析::::::::::::::::::::::::::::::::::::::

set CurPath=%~dp0

set CurPath=%CurPath:~0,-1%

set CurPath=%CurPath:\=\\%

set ALLUSERSPROFILE=%ALLUSERSPROFILE:\=\\%

set APPDATA=%APPDATA:\=\\%

set CommonProgramFiles=%CommonProgramFiles:\=\\%

set ProgramFiles=%ProgramFiles:\=\\%

set SystemRoot=%SystemRoot:\=\\%

set windir=%windir:\=\\%

set ComSpec=%ComSpec:\=\\%

set Path=%Path:\=\\%

set HOMEPATH=%HOMEPATH:\=\\%

set USERPROFILE=%USERPROFILE:\=\\%

::::::::::::::::::::::::在以下部分中需用%CurPath%替换批处理运行的路径::::::::::::::

::::::::::::::::::::::::::::::::::在以下部分中需用%%1替换%1::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::导入注册表::::::::::::::::::::::::::::::::::

if exist "%TEMP%\加速_安装.reg" del /q "%TEMP%\加速_安装.reg"

echo Windows Registry Editor Version 5.00>>"%TEMP%\加速_安装.reg"

echo [HKEY_USERS\.DEFAULT\Control Panel\Desktop]>>"%TEMP%\加速_安装.reg"

echo "AutoEndTasks"="1">>"%TEMP%\加速_安装.reg"

echo [HKEY_USERS\.DEFAULT\Control Panel\Desktop]>>"%TEMP%\加速_安装.reg"

echo "HungAppTimeout"="0">>"%TEMP%\加速_安装.reg"

echo [HKEY_USERS\.DEFAULT\Control Panel\Desktop]>>"%TEMP%\加速_安装.reg"

echo "WaitToKillAppTimeout"="0">>"%TEMP%\加速_安装.reg"

echo [HKEY_USERS\.DEFAULT\Control Panel\Desktop]>>"%TEMP%\加速_安装.reg"

echo "MenuShowDelay"="0">>"%TEMP%\加速_安装.reg"

regedit /s "%TEMP%\加速_安装.reg"

del /q "%TEMP%\加速_安装.reg"

:: 修改IDE通道检测设备模式,不接设备的设置为无,提高XP启动速度

:: 建议在系统第二次重新启动检测到所有已经安装的IDE设备后运行

::

:: Date: 2006.10.28

::

:: Date:2008.04.02

@echo off 改变bootini值

bootcfg /timeout 0

rem 恢复boot.ini的各种属性

@echo off清理垃圾

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\*.*"

del /f /s /q "D:\My Documents\Cookies\*.txt"

echo 系统垃圾清理完成!!!!!!!!! OK

echo 清除我的文档记录!

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /V NORECENTDOCSHISTORY /T REG_DWORD /D 1 /F

@set _debug=

@echo %_debug% off &setlocal ENABLEDELAYEDEXPANSION

set hkey1=HKLM\SYSTEM\CurrentControlSet\Enum\PCIIDE\IDEChannel

set hkey2=HKLM\SYSTEM\CurrentControlSet\Control\Class

echo 检测开始.........

for /f "usebackq tokens=*" %%I in (`reg query %hkey1% ^| find /i "IDEChannel\"`) do call :_check "%%I"

@ ECHO.

@ ECHO.

@ ECHO.

echo IED通道检测设备模式设置完成。

goto :eof

:_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 "0x0" >nul

if not %errorlevel%==1 goto _ChgMaster

echo “%DriverDesc%”的设备0上有设备存在。

goto _CheckSlave

:_ChgMaster

reg add "%hkey2%\%subkey%" /v UserMasterDeviceType /t REG_DWORD /d 3 /f >nul

echo “%DriverDesc%”的设备0上无设备,系统“检测方式”设置为无。

:_CheckSlave

reg query "%hkey2%\%subkey%" /v SlaveDeviceType | find /i "0x0" >nul

if not %errorlevel%==1 goto _ChgSlave

echo “%DriverDesc%”的设备1上有设备存在。

goto :eof

:_ChgSlave

reg add "%hkey2%\%subkey%" /v UserSlaveDeviceType /t REG_DWORD /d 3 /f >nul

echo “%DriverDesc%”的设备1上无设备,系统“检测方式”设置为无。

goto :eof

@ ECHO. 摘抄著名:束继涛 32240972

写成bat格式保证好用

Win10系统怎么优化最流畅?Win10系统是目前最主流的 *** 作系统,功能和体验都是最好的,随着微软的不断更新和支持,现在的Win10系统是最受欢迎的系统,那么新装的Win10系统怎么优化才能发挥出最大的性能呢?下面就给大家介绍一下如何优化Win10系统。

一、降低win10的窗口特效

大家都知道,特效越好,系统cpu负担就会越大,平时一般做李亏可能看不出来,但是在我们电脑运行大型程序的时候,就会让系统变得有点卡顿,压死骆驼的最后一根稻草呀,因此我们可以适当减弱一点动画效果,提升性能,就是没有那么好看了,可以自己选择哦;

*** 作方法

1、打开“控制面板”,按类别排序,选择“系统与安全”,点“系统”,进入系统信息界面。在左侧找到“高级系统设置”选择,点击进入。

2、在“性能”一栏,点击“设置”。Windows默认选择的是自动选择最佳设置,你可以自行更改为扰猜“调整为最佳性能”,或者自定义去除几个不需要的动画效果。

这个大家可以自己取舍,也是针对卡顿电脑,完美配置电脑请无视;

二、关闭win10的Project NEON透明效果

同样也是牺牲性能换取颜值的功能,但是电脑如果卡顿的话电脑都不想要了,还要什么颜值;

具体关闭方法,我们可以打开“开始菜单”,选择“设置”,再依次进入“个性化”-“颜色”,我们可以找到更多选项一栏,有个“透明效果”选项,将其关闭即可。

三、关闭win10的一些不常用的Connected User Experiences and Telemetry服务

对于我们来说基本是没有什么用的服务,而且白白占用资源,

1、“win+r”打开CMD命令提示符。输入“services.msc”打开,右侧找到

2、我们可以在打开的界面中,找到“Connected User Experiences and Telemetry”服务,右键“属性”,在“启动类型”里,将其设置成禁用即可。

四、关闭win10的Diagnostics诊断策略服务

此服务是用于收集用户的诊断信息的,并没有什么卵用,而且还相当耗费资源,我们同样可以在系统服务项里将其禁用。

1、用上面同样的方法,运行输入“services.msc”,打开服务项界面。

2、找到“Diagnostic Execution Service”、“Diagnostic Policy Service”、“Diagnostic Service Host”、“Diagnostic System Host”这四项服务,以同样的方法将其他设置为禁用即可。

五、关闭自带防火墙(如果自己安装了第三方安全软件)

自带防火墙没有什么用,而且如果自己安装防火墙软件的话,可能会造成冲突,还占用资源。

同样方法“win+r”打开CMD命令提示符。输入“services.msc”打开进入服务,右侧找到‘’Windows Defender Firewall‘’,点击属性,选择禁用;

六、关闭自动维护功能

自动维护在电脑空闲的时候进行一些磁盘清理、磁盘整理等等一 些计划任务很多时候反而引起电脑卡顿,建议关闭;

关闭方法:右键点击桌面上的 此电脑 ——属性——安全和维护——更改安全和维护设置——勾选或去掉“自动维护”——确定。

七、关闭磁盘整理计划

关闭方法:代开电脑随便选中一个磁盘》右键属性》工具》优化》更改设置》取消选择按计划运行。

八、定时清理

定时清理垃圾文件或者一些缓存文件,有一些小伙伴重装系统后发现自己C盘没有容量了,这就可能是windows.old文件夹占用了大量文件

快捷键Win+ r命令提示符,输入rd X:windows.old /s (X代表盘符)或在C盘右键》属性》磁盘清理,选中以前的windows、安装复选框,进行清理;

当然你也可以使用垃圾清理工具清理;

九、关闭第三方软件服务或者开机启动项

这我就不介绍了,使用自己安装的防火墙软件自己清理就好了;

十、加速关机

按下[Win+R]组合键打开运行,输入[gpedit.msc] 点击[确定] 依次展开[模

块管理] - [系统] - [关机选项],关闭会阻止或取消关机的应用程序的自动终止功能设置为禁用。

以上就是整理的一些win10系统优化常用 *** 纯神作了,适合笔记本台式机。

你没说是什么系统,我就给你一个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 ※交流邮箱:[email protected]

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


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

原文地址: https://outofmemory.cn/yw/12468361.html

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

发表评论

登录后才能评论

评论列表(0条)

保存