|
8#
楼主 |
发表于 2016-12-5 20:52:13
|
只看该作者
确实如你所说,晚上回到家后式了下是不行,帮忙改下可以吗谢谢了
我附上大致内容,你看看
@ECHO on
@title %username% W10_X64_14393_优化 ★使用有风险需谨慎★ 无名氏
%1 %2
ver|find "6.">nul&&exit /b
mshta vbscript:createobject("shell.application").shellexecute("""%~0""","goto :主菜单",,"runas",1)(window.close)&&exit /b
:主菜单
cls
pushd "%CD%"
CD /D "%~dp0"
:系统服务优化
cls
color 9F
ECHO.
call:colorIt 9c " ★★★ 警 告 ★★★ ★使用有风险需谨慎★"
ECHO * ◆ ◆ *
ECHO * W10添加图片查看器.5 ◆ ◆ E.系统服务备份/优化 *
ECHO.
SET youhua=
SET /P youhua=" 请输入选项,回车确认 "
IF NOT "%youhua%"=="" SET youhua=%youhua:~0,1%
if /i "%youhua%"=="E" goto 系统服务备份/优化
:系统服务备份/优化
cls&ECHO.
ECHO.
set fwbf=
set /p fwbf=" 输入 Y 备份服务 输入 N 优化服务 建议 在优化前 先做备份 "
IF NOT "%fwbf%"=="" SET fwbf=%fwbf:~0,1%
if /i "%fwbf%"=="Y" goto fwbf1
if /i "%fwbf%"=="N" goto fwbf2
ECHO.&ECHO.
call:colorIt 9c " !!! 汗…… 不会吧这也能选错?任意键返回重选吧 !!!"
pause>nul
goto :系统服务备份/优化
:fwbf1
cls&ECHO.
echo.
echo. 获得当前的日期和时间…… 获取所有的服务名称……
echo.
for /f "tokens=1, 2, 3, 4 delims=-/. " %%j in ('Date /T') do set fuwu=备份_%%j_%%k_%%l_%%m
for /f "tokens=1, 2 delims=: " %%j in ('TIME /T') do set fuwu=%fuwu%_%%j_%%k.bat
sc query type= service state= all| findstr /r /C:"SERVICE_NAME:" >"%tmp%\fuwu1.txt"
echo 正在备份服务到 %fuwu%
echo @echo Restore The Service Start State Saved At %TIME% %DATE% >"%fuwu%"
echo @pause >>"%fuwu%"
for /f "tokens=2 delims=:" %%j in (%tmp%\fuwu1.txt) do @( sc qc %%j |findstr START_TYPE >%tmp%\fuwu2.txt && for /f "tokens=4 delims=:_ " %%s in (%tmp%\fuwu2.txt) do @echo sc config %%j start= %%s >>"%fuwu%")
echo @pause >>"%fuwu%"
del /q "%tmp%\*.txt"
cls&ECHO.
echo 备份文件名: %fuwu% 位置:当前目录 按任意键返回
pause>nul
GOTO 系统服务优化
:fwbf2
cls&ECHO.
for /f "delims=" %%i in (Win10_批处理合集.bat) do (
if "%%i"==":147" call set isrun=flase
call :run %%i
if "%%i"==":123" call set isrun=true)
:run
if true==%isrun% call %1
for %%b in (2345PinyinSvc 2345SafeSvc 2345SoftSvc Protect_2345Explorer DPS FontCache iphlpsvc pcmastersvc QPCore QQPCRTP QQLiveService QQRepairFixSVC nvsvc icssvc HomeGroupListener HomeGroupProvider SysMain ShellHWDetection TrkWks Workstation) do (sc config %%b start= DISABLED)
echo.
echo 服务优化 结束 (需要重新启动电脑才生效) 按任意键返回
pause >nul
GOTO 系统服务优化
:恢复系统默认服务
cls&ECHO.
ECHO.
ECHO 开始恢复 系统默认服务 ...
ECHO.
:123
for %%b in (AppVClient NetTcpPortSharing RemoteAccess RemoteRegistry SCardSvr shpamsvc tzautoupdate UevAgentService) do (sc config %%b start= DISABLED)
:147
cls&ECHO.
echo.
echo 恢复系统默认服务 结束 (需要重新启动电脑才生效) 按任意键返回
pause >nul
GOTO 系统服务优化
:重启
shutdown /r /f /t 0
:logoff
logoff
:end
exit
:colorIt
pushd %tmp%&(set /p=" "<nul>temp)
ren temp %2 >nul 2>nul
findstr -a:%1 . %2*
ren %2 temp >nul 2>nul
endlocal&popd
|
|