System startup is usually declared good if the following two procedures are complete:
When a service fails to load during startup, its ErrorControl value is checked, as defined in the CurrentControlSet\Services\serviceName subkeys. Whether the system startup process continues or halts depends on this value.
This basic standard for verifying system startup will suit the needs for most situations; however, your site might require additional steps before considering a computer to be successfully started and ready to participate in the network.
For example, you might want to redefine startup validation for a server where, normally, no one logs on or where you want system startup to be validated as successful only after a particular process has started.
Or, for a server running Microsoft SQL Server, you might want a system startup to be marked as good only after the SQL server responds to a request. To do this, you might write a program that queries the SQL server and checks the response. If the response is not as expected, the program can call the NotifyBootConfigStatus() function with FALSE, causing the system to restart using the LastKnownGood control set. Or, the program might cause the system to run without saving the current configuration as the LastKnownGood control. Conversely, if the SQL server responds as expected, the program can call the NotifyBootConfigStatus() function with TRUE, causing the current configuration to be saved as the LastKnownGood control.
You can run such a verification program from the command prompt. Or, you can have the program run automatically during startup by specifying value entries under BootVerificationProgram in the Registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
\WinLogon
The data type for ReportBootOK is REG_SZ. When this value is 0, it disables the automatic startup acceptance that happens after the first successful logon.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
\Control\BootVerificationProgram
The data type for ImagePath must be REG_SZ or REG_EXPAND_SZ.
As another example, a computer setup for a turnkey application is a candidate for a custom startup verification routine, where the computer doesn't usually interact directly with users and you therefore don't want a successful user logon to be part of the system startup.
If you want a good system startup to be accepted from a remote computer (either manually or automatically), you can use the service program, BOOTVRFY.EXE, that is supplied with Windows NT. In this case, the remote computer accepts the system startup by starting the BOOTVRFY.EXE service. You can also write your own verification service that can reject the system startup and revert to the LastKnownGood control set to restart the computer.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Start : REG_DWORD : 0x00000003
Type : REG_DWORD : 0x00000020
ErrorControl : REG_DWORD : 0x00000001
ImagePath : REG_EXPAND_SZ : bootvrfy.exe
ObjectName : REG_SZ : LocalSystem
For more information about these entries, see "BootVerification Service Entries" in Chapter 14, "Registry Value Entries."
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
\WinLogon
This service tells the service controller on the local computer to save the current startup configuration as the LastKnownGood configuration, and then the service terminates itself.
Important You cannot use the BootVerification service in conjunction with settings in the BootVerificationProgram key. These are mutually exclusive methods.
You might also want a good system startup to depend on whether a specific service or driver loads. For example, for a server you might want to cause the Boot Loader to choose the LastKnownGood control set if the Server service doesn't start on the computer.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ServiceName
ServiceName can be any service upon which you want successful system startup to depend.
On a few rare occasions, you might want to specify a value of 3 (to fail the attempted startup if the service doesn't start); however, this ErrorControl value is usually reserved for critical services such as file system drivers.