写了个Vista的服务优化脚本
程序员文章站
2022-06-23 18:31:04
自己经常关掉vista里边的一些用不到的服务,节省些内存,手工改太麻烦,今晚花了点时间做了个自动优化还原的脚本 可以自动禁止不需要的服务 可以恢复vista安装时候的默认设...
自己经常关掉vista里边的一些用不到的服务,节省些内存,手工改太麻烦,今晚花了点时间做了个自动优化还原的脚本
可以自动禁止不需要的服务
可以恢复vista安装时候的默认设置
需要管理员权限运行
特色:可以通过修改服务列表方便的进行扩充,可以轻易的移植到xp
@echo off
goto start
:copyright
echo -----------------------------------------
echo - -
echo - windows vista home basic -
echo - service optimization tools -
echo - -
echo - copyright y97523[bcg] -
echo - china 2007-3-11 -
echo - -
echo -----------------------------------------
echo please run this as administor!
echo.
goto :eof
:start
:init
set svrlst=svr.lst
echo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>%svrlst%
echo ;;sevice name,start type(auto,demand,delayed-auto) ;;>>%svrlst%
echo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>>%svrlst%
echo dps,auto >>%svrlst%
echo ;wdisystemhost,demand >>%svrlst%
echo trkwks,auto >>%svrlst%
echo ikeext,auto >>%svrlst%
echo iphlpsvc,auto >>%svrlst%
echo policyagent,auto >>%svrlst%
echo wpdbusenum,auto >>%svrlst%
echo spooler,auto >>%svrlst%
echo emdmgmt,auto >>%svrlst%
echo lanmanserver,auto >>%svrlst%
echo ;ssdpsrv,demand >>%svrlst%
echo tabletinputservice,auto >>%svrlst%
echo lmhosts,auto >>%svrlst%
echo ;tapisrv,demand >>%svrlst%
echo webclient,auto >>%svrlst%
echo wersvc,auto >>%svrlst%
echo stisvc,auto >>%svrlst%
echo lanmanworkstation,auto >>%svrlst%
echo w3svc,auto >>%svrlst%
rem type %svrlst%
:choise
cls
call :copyright
echo please select your choise
set /p choise= optimization service(o)/restore default service setting(r)/exit(x):
if /i "%choise%" == "o" goto optimization
if /i "%choise%" == "r" goto restore
if /i "%choise%" == "x" goto exit
goto choise
:optimization
echo ------start optimization service------
for /f "eol=; tokens=1,2* delims=," %%i in (%svrlst%) do echo %%i: &&sc config "%%i" start= disabled
echo.
echo ------optimization completed,check any error------
echo push any key to return!
pause >nul
goto choise
:restore
echo ------restore default service------
for /f "eol=; tokens=1,2* delims=," %%i in (%svrlst%) do echo %%i: &&sc config "%%i" start= %%j
echo.
echo ------restore completed,check any error------
echo push any key to return!
pause >nul
goto choise
:exit
del %svrlst% /q
可以自动禁止不需要的服务
可以恢复vista安装时候的默认设置
需要管理员权限运行
特色:可以通过修改服务列表方便的进行扩充,可以轻易的移植到xp
@echo off
goto start
:copyright
echo -----------------------------------------
echo - -
echo - windows vista home basic -
echo - service optimization tools -
echo - -
echo - copyright y97523[bcg] -
echo - china 2007-3-11 -
echo - -
echo -----------------------------------------
echo please run this as administor!
echo.
goto :eof
:start
:init
set svrlst=svr.lst
echo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>%svrlst%
echo ;;sevice name,start type(auto,demand,delayed-auto) ;;>>%svrlst%
echo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>>%svrlst%
echo dps,auto >>%svrlst%
echo ;wdisystemhost,demand >>%svrlst%
echo trkwks,auto >>%svrlst%
echo ikeext,auto >>%svrlst%
echo iphlpsvc,auto >>%svrlst%
echo policyagent,auto >>%svrlst%
echo wpdbusenum,auto >>%svrlst%
echo spooler,auto >>%svrlst%
echo emdmgmt,auto >>%svrlst%
echo lanmanserver,auto >>%svrlst%
echo ;ssdpsrv,demand >>%svrlst%
echo tabletinputservice,auto >>%svrlst%
echo lmhosts,auto >>%svrlst%
echo ;tapisrv,demand >>%svrlst%
echo webclient,auto >>%svrlst%
echo wersvc,auto >>%svrlst%
echo stisvc,auto >>%svrlst%
echo lanmanworkstation,auto >>%svrlst%
echo w3svc,auto >>%svrlst%
rem type %svrlst%
:choise
cls
call :copyright
echo please select your choise
set /p choise= optimization service(o)/restore default service setting(r)/exit(x):
if /i "%choise%" == "o" goto optimization
if /i "%choise%" == "r" goto restore
if /i "%choise%" == "x" goto exit
goto choise
:optimization
echo ------start optimization service------
for /f "eol=; tokens=1,2* delims=," %%i in (%svrlst%) do echo %%i: &&sc config "%%i" start= disabled
echo.
echo ------optimization completed,check any error------
echo push any key to return!
pause >nul
goto choise
:restore
echo ------restore default service------
for /f "eol=; tokens=1,2* delims=," %%i in (%svrlst%) do echo %%i: &&sc config "%%i" start= %%j
echo.
echo ------restore completed,check any error------
echo push any key to return!
pause >nul
goto choise
:exit
del %svrlst% /q
上一篇: 备份硬盘引导记录的方法