@SERVICE[service,info] : Returns information about the specified service.

 

service - The service name to query. If the service doesn't exist, @SERVICE will return -1.

 

info - The information you want:

 

1The type of service. This will return one or more of the following values:

 

1Device driver
2File system driver
16The service runs in its own process
32The service shares a process with other services
256The service can interact with the desktop

 

2The current state of the service. This will return one of the following values:

 

1The service is not running
2The service is starting
3The service is stopping
4The service is running
5The service continue is pending
6The service pause is pending
7The service is paused

 

3Returns the check-point value the service increments to report its progress during a lengthy start, stop, pause, or continue operation. This value will be 0 if there is no pending operation.

 

4The control codes the service accepts and processes in its handler function. This will return a combination of the following values (you can check the return value with the @EVAL OR test):

 

1The service can be stopped
2The service can be paused and continued
4The service is notified when system shutdown occurs
8The service can reread its startup parameters without being stopped and restarted
16The service is a network component that can accept changes in its binding without being stopped and restarted
32The service is notified when the computer's hardware profile has changed
64The service is notified when the computer's power status has changed
128The service is notified when the computer's session status has changed
256The service can perform pre-shutdown tasks

 

5Returns the estimated time required for a pending start, stop, pause, or continue operation (in milliseconds).

 

Examples:

 

echo %@service[audiosrv,1]

16

 

echo %@service[audiosrv,2]

4

 

echo %@service[audiosrv,3]

0

 

echo %@service[audiosrv,4]

193