|
|
|
|
ServiceWaitStatus (Function) In french: ServiceAttendEtat Waits for a service to be in a specific status. This service can be found on the local computer or on a remote computer.
// Wait for the service in TABLE_Service to start Res is int ServiceStart(COL_Name[TABLE_Service]) Res = ServiceWaitStatus(COL_Name[TABLE_Service], serviceStatusStarted, 10) IF Res = -1 THEN Error(ErrorInfo()) ELSE Info("Status at the end of timeout: " + StatusInText(Res)) END
Syntax
<Result> = ServiceWaitStatus(<Service name> , <Expected status> [, <Timeout> [, <Remote computer>]])
<Result>: Integer constant - Current status of the service,
| | serviceStatusPaused | The service is paused. | serviceStatusPausing | The service received a command to pause but it has not been paused yet. | serviceStatusRestarting | The service received a command to restart but it has not been restarted yet. | serviceStatusStarted | The service is currently operating. | serviceStatusStarting | The service received a command to start but it has not been started yet. | serviceStatusStopped | The service is stopped. | serviceStatusStopping | The service received a command to stop but it has not been stopped yet. | serviceStatusTimeout | The service has not reached the requested status at the end of the timeout. |
- -1 if an error occurred. To get more details on the error, use ErrorInfo.
<Service name>: Character string Name of the service to use. <Expected status>: Integer constant Expected status of the service: | | serviceStatusPaused | The service is paused. | serviceStatusPausing | The service received a command to pause but it has not been paused yet. | serviceStatusRestarting | The service received a command to restart but it has not been restarted yet. | serviceStatusStarted | The service is currently operating. | serviceStatusStarting | The service received a command to start but it has not been started yet. | serviceStatusStopped | The service is stopped. | serviceStatusStopping | The service received a command to stop but it has not been stopped yet. |
<Timeout>: Optional integer or optional Duration Maximum timeout (in seconds). This parameter can correspond to: - an integer corresponding to the number of seconds,
- a Duration variable,
- the duration in a readable format (e.g., 1 s).
If this parameter is not specified, the timeout is set to 10 seconds. <Remote computer>: Optional character string - IP address of the remote computer in xxx.xxx.xxx.xxx format (returned by NetIPAddress),
- Name of the remote computer (returned by NetMachineName).
This parameter is used to handle a service on another computer. To use this option, the user must be administrator of remote computer. If this parameter is not specified or if it corresponds to an empty string (""), the service is handled locally.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|