ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Service functions
  • Overview
  • Service variable
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Service variable
Overview
The Service variable is used to:
Service variable
The Service variable includes the following elements:
ElementTypeEffect
Service.StartupInteger constantService start mode:
  • serviceAutomaticStart Automatic startup after system initialization.
  • serviceStartDisabled: Service is disabled. Any attempt to start it triggers an error.
  • serviceManualStart Manual start (e.g. with function ServiceStart).
  • serviceSystemStart Automatic startup at the same time as the operating system (used by drivers).
Service.DelayedStartupBooleanSpecifies that the service will not be started immediately when the system starts but a little bit later.
Windows Remarks:
  • This element is only taken into account for Windows services.
  • This element is only taken into account starting with Windows Vista.
Service.DescriptionCharacter stringService description.
Windows Remark: This information appears in the "Full name" section of the service manager.
Service.LongDescriptionCharacter stringDetailed description of the service.
Windows Note: this information appears in the "Description" section of the service manager.
Service.StartupErrorInteger constantThe errors that occurred when starting a service are processed by Windows (for the services with automatic start):
  • serviceCriticalError The system records the service startup failure in the Event Viewer log and restarts in "Last known good configuration" mode.
  • serviceGraveError The system records the service startup failure in the Event Viewer log and restarts in "Last known good configuration" mode, if not already in this mode.
  • serviceErrorIgnore The system does nothing special if the service fails to start.
  • serviceErrorLog The system writes the service startup failure to the event viewer log.
Service.CommandLineCharacter stringFull command line of the service (path of the executable and parameters).
Service.TypeInteger constantType of the service:
  • serviceTypeInteractiveShared Service authorized to interact with the office and share its Process with other services.
  • serviceTypeInteractiveSimple Service authorized to interact with the desktop and operating alone in its Process.
  • serviceTypeShared Standard service sharing its Process with other services.
  • serviceTypeKernelPilot Core driver.
  • serviceTypeFileSystemDriver File system driver.
  • serviceTypeSimple Standard service operating alone in its Process.
Service.UserCharacter string or String constantUser account that will run the service or one of the following constants:
  • LocalServiceAccount Local account that has recommended rights to run a service. On the network, this account will be considered as guest. This constant is available in modification only (ServiceModify).
  • NetworkServiceAccount Local account with recommended rights to run a service. On the network, this account will have the rights of the current computer.
  • LocalSystemAccount Local account representing the operating system. This account has all the rights. On the network, this account will have the rights of the current computer.
    This constant corresponds to the "LocalSystem" account.
Note Accounts identified by the constants LocalServiceAccount,NetworkServiceAccount and LocalSystemAccount have no password.
Service.PasswordCharacter stringPassword of the user account
Note If a service is of a type authorized to interact with the desktop (serviceTypeInteractiveShared or serviceTypeInteractiveSimple), its user account must be LocalSystemAccount. The other values will be ignored. Services authorized to interact with the desktop are not available since Windows Vista.
Windows From Windows 2000, additional elements are available to manage the service failures. A service failure is an executable stoppage following a fatal error. In Windows NT and Linux, these elements are ignored.
ElementTypeEffect
Service.NbActionOnFailureIntegerNumber of elements in the Service.ActionOnFailure and Service.TimeoutBeforeActionOnFailure arrays.
  • At the first failure of the service, the action specified in Service.ActionOnFailure[1] is run.
  • At the Nth failure of the service, the action specified in Service.ActionOnFailure[n] is run. If the array contains less than n elements, the last action described is repeated for all the following failures.
Service.ActionOnFailureArray of Integer constantsAction performed if the service fails:
  • serviceFailureIgnore: service failure is ignored, service stops.
  • serviceFailureLaunchAppli the service manager launches the Command described in Service.LaunchAppliOnFailure.
  • serviceFailReboot: the service manager restarts the computer.
  • serviceFailureRestartService: the service manager restarts the service.
Service.TimeoutBeforeActionOnFailureArray of integersTimeout (in milliseconds) before triggering the action specified in Service.ActionOnFailure.
Service.StartAppOnFailureCharacter stringCommand line called in the process of the serviceFailureStartApp action.
If this command line contains the %1 string, this one will be replaced with the number of successive service failures during the call.
Service.MessageRebootOnFailureCharacter stringMessage sent to the users connected to the computer via the network in case of system reboot.
Service.ReinitFailureCounterIntegerTimeout (in seconds) after which the failure counter is reset to 0 if no failure occurred.
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help