Hitachi

JP1 Version 13 JP1/Script Description and Reference (For Windows Systems)


9.5.4 ServiceDelete (delete a service)

Purpose

Deletes a service.

Syntax
ServiceDelete(ServiceInfoName)
Argument
ServiceInfoName

Specify the service information name of the service to be deleted. Write a character string or a variable that stores this value.

Description

The ServiceDelete command deletes a service registered in the system, using the value stored in the keyword Name in the service information.

The execution result is stored in the _SVC_RTN_ reserved variable. The command returns True on successful execution, or False for all other states.

Note

Execute the script file as a user who has administrator permissions. For details, see 1.8.3 Effect of the executing user on command behavior.

Important

Do not execute this command for services that cannot be stopped. This command issues a stop request to the specified service to be deleted, and will not terminate until the specified service stops so that it can be deleted.

Example
' Delete the JP1/Script service if it exists.
ServiceSetValue("JSService", Name::"JP1_Script")
If  IsExistService("JSService")  Then
  ServiceDelete("JSService")
End
JP1/Script version

Supported from JP1/Script 01-00.