
| Quote: | |
|
CODE: [Copy to clipboard]我就只能写成这样了,不使用临时文件。@echo off & setlocal EnableDelayedExpansion
echo ===========================================&echo 非系统服务
for /f "skip=3" %%a in ('wmic service get name^|findstr /v /i "6to4 Alerter aspnet_state clr_optimization_v2.0.50727_32 ALG AppMgmt AudioSrv BITS Browser CiSvc ClipSrv COMSysApp CryptSvc DcomLaunch Dhcp dmadmin dmserver Dnscache ERSvc Eventlog EventSystem FastUserSwitchingCompatibility helpsvc HidServ HTTPFilter ImapiService lanmanserver lanmanworkstation LmHosts Messenger mnmsrvc MSDTC MSIServern RsRavMon NVSvc NetDDE NetDDEdsdm Netlogon Netman Nla NtLmSsp NtmsSvc PlugPlay PolicyAgent ProtectedStorage RasAuto RasMan RDSessMgr RemoteAccess RemoteRegistry RpcLocator RpcSs RSVP SamSs SCardSvr Schedule Spooler srservice SSDPSRV stisvc Stormser usprserv WMPNetworkSvc WudfSvc seclogon SENS SharedAccess ShellHWDetection Spoolersr serviceSSDP SRVstisvc SwPrv SysmonLog TapiSrv TermService Themes TlntSvr TrkWks UMWdf upnphost UPS VSS W32Time WebClient winmgmt WmdmPmSN Wmi WmiApSrv wscsvc wuauserv WZCSVC xmlprov MSIServer"') do (if "%%a" neq "N/A" (set A=0
for %%b in (Caption State StartMode pathname) do for /f "skip=1 delims=" %%i in ('wmic service where "name='%%a'" get %%b') do set B=%%i&set B=!B:~0,-1!&set B=!B: =!&set /a A+=1&set B!A!=!B!
echo.%%a&echo.[!B1!] [!B2!/!B3!]&echo.!B4!))
pause
CODE: [Copy to clipboard][ Last edited by Hanyeguxing on 2009-10-5 at 03:34 ]@echo off & setlocal EnableDelayedExpansion
echo ===========================================&echo 非系统服务
for /f "skip=3" %%a in ('wmic service get name^|findstr /v /i "6to4 Alerter aspnet_state clr_optimization_v2.0.50727_32 ALG AppMgmt AudioSrv BITS Browser CiSvc ClipSrv COMSysApp CryptSvc DcomLaunch Dhcp dmadmin dmserver Dnscache ERSvc Eventlog EventSystem FastUserSwitchingCompatibility helpsvc HidServ HTTPFilter ImapiService lanmanserver lanmanworkstation LmHosts Messenger mnmsrvc MSDTC MSIServern RsRavMon NVSvc NetDDE NetDDEdsdm Netlogon Netman Nla NtLmSsp NtmsSvc PlugPlay PolicyAgent ProtectedStorage RasAuto RasMan RDSessMgr RemoteAccess RemoteRegistry RpcLocator RpcSs RSVP SamSs SCardSvr Schedule Spooler srservice SSDPSRV stisvc Stormser usprserv WMPNetworkSvc WudfSvc seclogon SENS SharedAccess ShellHWDetection Spoolersr serviceSSDP SRVstisvc SwPrv SysmonLog TapiSrv TermService Themes TlntSvr TrkWks UMWdf upnphost UPS VSS W32Time WebClient winmgmt WmdmPmSN Wmi WmiApSrv wscsvc wuauserv WZCSVC xmlprov MSIServer"') do (if "%%a" neq "N/A" (set A=0
for %%b in (Caption State StartMode pathname) do for /f "skip=1 delims=" %%i in ('wmic service where "name='%%a'" get %%b') do (set B=%%~i&call :han "!B!"
set /a A+=1&set B!A!=!B!)
echo.%%a&echo.[!B1!] [!B2!/!B3!]&echo.!B4!))
pause&exit
:han
set B=%~1
:ye
if "%B:~-1%"==" " (set B=%B:~0,-1%&goto ye) else goto :eof
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |