ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Service functions
  • Overview
  • Service variable
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The Service variable is used to:
Service variable
The Service variable includes the following elements:
ElementTypeEffect
Service.StartupInteger constantService start mode:
  • serviceStartupAutomatic: Automatic startup once the system is initialized.
  • serviceStartupDisabled: The service is disabled. Any attempt to start it triggers an error.
  • serviceStartupManual: Manual start (with ServiceStart for example).
  • serviceStartupSystem: Automatic start at the same time as the operating system (used by the 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 stringDescription of the service.
Windows Remark: This information appears in the "Full name" item of the service manager.
Service.LongDescriptionCharacter stringDetailed description of the service.
Windows Remark: this information appears in the "Description" item of the service manager.
Service.StartupErrorInteger constantThe errors that occurred when starting a service are processed by Windows (for the services with automatic start):
  • serviceErrorCritical: The system writes the start service failure in the event observer log and restarts in "Last proper configuration known" mode.
  • serviceErrorSerious: The system writes the start service failure in the event observer log and restarts in "Last proper configuration known" mode if it is not already is that mode.
  • serviceErrorIgnore: The system performs no action if the service does not start.
  • serviceErrorLog: The system writes the start service failure in the event observer log.
Service.CommandLineCharacter stringFull command line of the service (path of the executable and parameters).
Service.TypeInteger constantType of the service:
  • serviceTypeInteractiveShared: Service allowed to interact with the desktop and sharing its process with other services.
  • serviceTypeInteractiveSimple: Service allowed to interact with the desktop and operating on its own in its process.
  • serviceTypeShared: Standard service sharing its process with other services.
  • serviceTypeDriverKernel: Driver of the kernel.
  • serviceTypeDriverFileSystem: Driver of file system.
  • serviceTypeSimple: Standard service operating on its own in its process.
Service.UserCharacter string or String constantUser account that will run the service or one of the following constants:
  • AccountLocalService: Local account that has the recommended rights to run a service. On the network, this account will be considered as guest. This constant is available in modification only (ServiceModify).
  • AccountNetworkService: Local account that has the recommended rights to run a service. On the network, this account will have the rights of the current computer.
  • AccountLocalSystem: 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.
Remark: Accounts identified via the AccountLocalService,AccountNetworkService and AccountLocalSystem constants do not have a password.
Service.PasswordCharacter stringPassword of the user account
Remark: If a service is allowed to interact with the desktop (serviceTypeInteractiveShared or serviceTypeInteractiveSimple), its user account must be set to AccountLocalSystem. 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: the failure of the service is ignored, the service stops.
  • serviceFailureStartApp: the service manager runs the command described in Service.StartAppOnFailure.
  • serviceFailureReboot: the service manager restarts the computer.
  • serviceFailureRestartService: the service manager restarts the service.
Service.TimeoutBeforeActionOnFailureArray of integersTime-out (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 by 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.ReinitFailureCounterIntegerTime-out (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: 07/03/2023

Send a report | Local help