Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
Antecedent services are services that must be running before dependent services can start. This information is extremely valuable for anyone writing scripts that automatically start services. By enumerating the antecedent services, you can ensure that all required services are already running before you attempt to start a dependent service. Alternatively, by enumerating antecedent services, you can also determine which dependent services you might not want to start. When you start a dependent service, its antecedent services automatically start; in some cases, you might prefer to leave those services inactive.
Antecedent services can be enumerated by using a script similar to the one used to enumerate dependent services. If you set the service role to Dependent in your WMI script, it lists the antecedents for a particular service.
Listing 15.15 contains a script that enumerates the antecedents of the Fax service. To carry out this task, the script must perform the following steps:
This query must use an Associators of query and specify the following information:
This returns a collection consisting of all the services for which the Fax service is a dependent.
Listing 15.15 Enumerating Antecedent Services
|
|
Send us your feedback | « Previous | Next » |