Skip navigation

JSI Tip 8560. What services and drivers are configured to start but are currently stopped?


Using information from tip 0324 » Registry entries for services, SC.EXE built into your operating system or from the Resource Kit, and REG.EXE built into your operating system or from the Support Tools on your CD-ROM, I have scripted SDNS.bat to display the Service Name, Start value, and Type value for those services and drivers which are configured to start but are currently stopped.

The syntax for using SDNS.bat is:

SDNS

SDNS.bat contains:

@echo off
setlocal
sc queryex type= all state= inactive>"%TEMP%\scqueryex.tmp"
for /f "Tokens=1*" %%a in ('type "%TEMP%\scqueryex.tmp"^|Findstr /L /I /C:"SERVICE_NAME:"') do (
 set obj=%%b
 call :chkstrt
)
del /q "%TEMP%\scqueryex.tmp"
endlocal
goto :EOF
:chkstrt
for /f "Tokens=3" %%s in ('reg query "HKLM\System\CurrentControlSet\Services\%obj%" /V Start') do (
 set start=%%s
)
for /f "Tokens=3" %%t in ('reg query "HKLM\System\CurrentControlSet\Services\%obj%" /V Type') do (
 set Type=%%t
)
if /i "%start:~2,1%" GTR "2" goto :EOF
@echo %obj% Type=%Type%, Start=%start%



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish