Jump to content

SrvDependencyWalker


Camarade_Tux

Recommended Posts

Hi everybody,

I've just coded a small AHK script to speedup windows startup.

Sometimes windows lags at startup : CPU and HDs are both idle but windows is not started yet.

The cause is often a service that is dependant on another which has been set to manual/disabled start.

Such dependencies are listed in the registry but there are just too many services to check all of them by hand.

My script does nothing on itself : it just displays a message telling "such service is set to start automatically but is dependent upon such other service that is disabled". Then it's up to the user to do the changes. There are two reasons for this : 1) I'm sure there will never be any damage caused by my script, 2) I'm lazy :P

To change a service startup mode, open regedit, go to SYSTEM\CurrentControlSet\Services, select the key with the name that was not between parenthesis (this one is used in services.msc not regedit).

In regedit, there are much more services listed than in services.msc. This is because some drivers are included too and services.msc does not lists all services on purpose.

The code is really simple:

Auto=0
Manual=0
Disabled=0
Loop HKLM, SYSTEM\CurrentControlSet\Services, 2, 0
{
RegRead DependOnService, HKLM, SYSTEM\CurrentControlSet\Services\%A_LoopRegName%, DependOnService
RegRead Own_Start, HKLM, SYSTEM\CurrentControlSet\Services\%A_LoopRegName%, Start
Own_Name := A_LoopRegName
RegRead Own_Cute_Name, HKLM, SYSTEM\CurrentControlSet\Services\%A_LoopRegName%, DisplayName
Loop Parse, DependOnService, `n
{
RegRead Dependency_Start, HKLM, SYSTEM\CurrentControlSet\Services\%A_LoopField%, Start
Dependency_Name := A_LoopField
RegRead Dependency_Cute_Name, HKLM, SYSTEM\CurrentControlSet\Services\%A_LoopField%, DisplayName
if (Dependency_Start="2")
Auto++
if (Dependency_Start="3") {
Manual++
if (Own_Start="2")
MsgBox,
(
The %Own_Name% (%Own_Cute_Name%) service which is set to start automatically depends on
%Dependency_Name% (%Dependency_Cute_Name%)`r
but this service is set to start manually.
)
}
if (Dependency_Start="4") {
Disabled++
if (Own_Start="2")
MsgBox,
(
The %Own_Name% (%Own_Cute_Name%) service which is set to start automatically depends on
%Dependency_Name% (%Dependency_Cute_Name%)`r
but this service is set to never start.
)
if (Own_Start="3")
MsgBox,
(
The %Own_Name% (%Own_Cute_Name%) service which is set to start manually depends on
%Dependency_Name% (%Dependency_Cute_Name%)`r
but this service is set to never start.
)
}
}
}
MsgBox Auto : %Auto%`rManual : %Manual%`rDisabled : %Disabled%

ExitApp

You can copy-past this in a text file and drag-and-drop it over AutoHotKey.exe or get the attached file.

Last, could you run the script even if you don't have such lags and post the results here ? Make the message box active and hit Ctrl+C

I'm curious about some MS mistakes. ;)

PS : if you copied-pasted the code and it doesn't work, get the attached file; I made some modifications inside the codebox so that it doesn't destroy the topic layout (continuation sections).

SrvDependency.7z

Edited by Camarade_Tux
Link to comment
Share on other sites


On my computer, I received:

-SENS dependent on COM+, maybe because of nlite use

-WZCSVC dependent on ndisuio, same : microsoft services with stock settings (but I dont' know how being a driver influences this)

I guess you know Dhcp is dependent on NetBT, which creates a lag when you remove (or at least disable?) NetBT with nlite. ;)

Fast no non-microsoft services use the DependOnService key. ;)

So everything retrieved here concerns MS services.

And as far as I've understood, Manual mode is not designed for such cases : it is for the case the user on himself would want to do a "net start", not for apps to launch their own services. Source :

0x3 Service Available, regardless of type,

(Load on Control but will not be started until

demand) Manager the user starts it (for example,

by using the Devices icon in

Control Panel).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...