Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
Not all services can be stopped, and even fewer services can be paused. The capability of being stopped or paused must be coded into the service itself; without this code, the service does not respond to stop or pause requests. In particular, services that run as part of Services.exe (the process that is also responsible for running the SCM) can be neither stopped nor paused. If Services.exe could be stopped, that would stop the SCM. Without the SCM, all other services on the computer would be unable to function.
You can query the WMI AcceptStop and the AcceptPause properties to determine which services can be paused and which services can be stopped. For example, of the 88 services installed on a particular Windows 2000 domain controller, 54 were capable of being stopped, but only 17 were capable of being paused.
The scripts for determining which services can be stopped or which services can be paused are similar.
Listing 15.7 contains a script that displays a list of services that can be stopped. To carry out this task, the script must perform the following steps.
Listing 15.7 Determining Which Services Can Be Stopped
|
|
To determine which services can be paused, you can use a script similar to Listing 15.7 but substitute the AcceptPause property for the AcceptStop property in the Where clause, as shown in Listing 15.8. The output displayed in the command window lists the services that can be paused instead of those that can be stopped.
Listing 15.8 Determining Which Services Can Be Paused
|
|
Send us your feedback | « Previous | Next » |