PALATINELABSDocsENES

Pages

↑↓ to moveEnter to openEsc to close

Service package guide

Read and change the state of a local Windows service.

Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested.

Jump to actions

Packages

Prerequisites

Use Windows with this package installed. Services are local to the current Device; you cannot name a remote computer. Use the service name, such as SampleWorker; a display name might not be found. The account needs permission to read and control the service.

Pause, Resume, Start and Stop wait up to 30 seconds; you cannot change this time. If the service is already in that state, nothing changes. Every action and condition fails (it does not return an empty value or false) if the service is missing, the name is empty, you do not have the rights, or reading the state fails. A change also fails if it is not supported or 30 seconds pass (the service can still be changing). Test with a service that other programs do not use, such as a test service SampleWorker that supports pause and continue, and read its state before you change it.

Shared fields

Every action and condition uses these fields.

InputEditor fieldType; default; requirementUse
serviceOptionSourceServiceNameSourcedefault BY_SELECTIONoptionalBY_SELECTION reads serviceNameBySelection⁠; BY_TEXT reads serviceNameByText⁠. The other name is ignored.
serviceNameBySelectionService listStringdefault emptyrequired for BY_SELECTIONLocal service name, such as SampleWorker⁠; outer spaces are removed.
serviceNameByTextVariableStringdefault emptyrequired for BY_TEXTSampleWorker⁠, or a String reference such as $serviceName$ that holds it.

Actions

Get service status (serviceGetStatus)

Read the current state without waiting for a change to finish. Use it before a branch or a change.

Inputs

Uses the shared fields.

Outputs

OutputTypeMeaning
resultStringExact Windows state name, such as Running⁠.

Example

SampleWorker is running. Set serviceOption=BY_TEXT and serviceNameByText=SampleWorker. Bind result to String variable state.

Expected result

state is Running. Other states are Stopped, Paused, StartPending, StopPending, PausePending and ContinuePending.

Back to actions

Pause service (servicePause)

Pause a local service and wait for Paused. The service must support pause.

Inputs

Uses the shared fields.

Outputs

No output variables.

Example

SampleWorker is Running. Set serviceOption=BY_SELECTION and serviceNameBySelection=SampleWorker.

Expected result

Get service status returns Paused.

Back to actions

Resume service (serviceResume)

Resume a local service and wait for Running. The service must support continue.

Inputs

Uses the shared fields.

Outputs

No output variables.

Example

SampleWorker is Paused. Set serviceOption=BY_SELECTION and serviceNameBySelection=SampleWorker.

Expected result

Get service status returns Running.

Back to actions

Start service (serviceStart)

Start a local service and wait for Running. The services it needs and the rights to start it must be available.

Inputs

Uses the shared fields.

Outputs

No output variables.

Example

SampleWorker is Stopped. Set serviceOption=BY_SELECTION and serviceNameBySelection=SampleWorker.

Expected result

Get service status returns Running.

Back to actions

Stop service (serviceStop)

Stop a local service and wait for Stopped. Work that depends on it can be interrupted.

Inputs

Uses the shared fields.

Outputs

No output variables.

Example

SampleWorker is Running. Set serviceOption=BY_SELECTION and serviceNameBySelection=SampleWorker.

Expected result

Get service status returns Stopped.

Back to actions

Conditions

Service is not running (serviceIsNotRunning)

True when the service is not Running now (paused and pending count as not running).

Inputs

Uses the shared fields.

Outputs

Gives true or false.

Example

SampleWorker is Running. Set serviceOption=BY_TEXT and serviceNameByText=SampleWorker, then use the condition in a branch.

Expected result

false for Running; true for every other state.

Back to conditions

Service is running (serviceRunning)

True when the service is Running now.

Inputs

Uses the shared fields.

Outputs

Gives true or false.

Example

SampleWorker is Running. Set serviceOption=BY_TEXT and serviceNameByText=SampleWorker, then use the condition in a branch.

Expected result

true for Running; false for every other state.

Back to conditions