Hitachi

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


9.5.1 ServiceSetValue (set service information)

Purpose

Sets the information required to operate a service as a service information object.

Syntax
ServiceSetValue(ServiceInfoName, Keyword1::Value1, Keyword2::Value2, ...)
Arguments
ServiceInfoName

Specify the name of the service information object as a character string or as a variable that stores this value. A maximum of 31 single-byte characters can be specified.

Keyword1 to Keyword11

Specify each keyword for which a value is to be set.

Value1 to Value11

Set a value to each keyword.

Write two colons (::) between the keyword and corresponding value. You can specify the following keywords and values:

Keyword

Value and meaning

Name

Service name

Specify up to 255 characters. Forward-slash (/) and back-slash (\) are not permitted as service name characters.

DispName

Display name

Specify up to 255 characters.

Type

Service type

SERVICE_WIN32_OWN_PROCESS

The service runs as an independent Win32 process.

SERVICE_WIN32_SHARE_PROCESS

The service shares a Win32 process with another service.

SERVICE_KERNEL_DRIVER

The service is a Windows device driver.

SERVICE_FILE_SYSTEM_DRIVER

The service is a Windows file system driver.

Start

Time at which the service starts

SERVICE_BOOT_START

The operating system loader starts the device driver. This value is valid only when either of the following service types is specified in Type:

  • SERVICE_KERNEL_DRIVER

  • SERVICE_FILE_SYSTEM_DRIVER

SERVICE_SYSTEM_START

The IoInitSystem function starts the device driver. This value is valid only when either of the following service types is specified in Type:

  • SERVICE_KERNEL_DRIVER

  • SERVICE_FILE_SYSTEM_DRIVER

SERVICE_AUTO_START

The service control manager automatically starts the device driver or Win32 service at system startup.

SERVICE_DEMAND_START

The service control manager starts the device driver or Win32 service when the StartService function is invoked from the process.

SERVICE_DISABLED

The device driver or Win32 service can no longer be started.

Errctl

Error severity if the service fails to start at system startup

SERVICE_ERROR_IGNORE

The boot program logs the error and continues startup processing.

SERVICE_ERROR_NORMAL

The boot program logs the error, displays a pop-up message, and continues startup processing.

SERVICE_ERROR_SEVERE

The boot program logs the error.

SERVICE_ERROR_CRITICAL

The boot program logs the error if it is possible.

Path

Full path of the service program

Group

Load ordering group to which the service belongs

Omit this value if the service does not belong to a group.

DependG

Dependency on a group

Specify the load ordering group that must be started before this service.

DependM

Dependency on a service

Specify the service that must be started before this service. Omit this value if the service has no dependencies.

StartName

Service account name

SERVICE_WIN32_OWN_PROCESS specified in Type

The service is logged on as an account name in the form DomainName\Username. If the service account belongs to the built-in domain, specify the name as \UserName.

SERVICE_WIN32_SHARE_PROCESS specified in Type

The LocalSystem account must be used. If you omit this value, the service is logged on under the LocalSystem account.

SERVICE_KERNEL_DRIVER, or SERVICE_FILE_SYSTEM_DRIVER, specified in Type

This value is the name of the driver object (\FileSystem\Rdr, or \Driver\Xns, for example) used when the I/O system loads the device driver. If you omit this value, the I/O system creates a default object name based on the service name, and starts the driver using this name.

Password

Account password

SERVICE_WIN32_OWN_PROCESS, or SERVICE_WIN32_SHARE_PROCESS, specified in Type

Specify the password of the service account set in StartName.

SERVICE_KERNEL_DRIVER, or SERVICE_FILE_SYSTEM_DRIVER, specified in Type

This value is ignored.

Omit this value if the service has no password.

Description

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

Service information refers to an object that encapsulates information about the service. You can set and acquire these attributes using the above keywords.

Before you use any other service operation command, set the keywords required in the service information, using the ServiceSetValue command. You can omit unnecessary keywords.

Example
OutDir = "C:\Program Files\Hitachi\Script\BIN\"
ServiceSetValue("JSService", Name::"JP1_Script"   _
                 , DispName::"JP1/Script"   _
                 , Type::SERVICE_WIN32_OWN_PROCESS   _
                 , Start::SERVICE_AUTO_START   _
                 , Errctl::SERVICE_ERROR_NORMAL   _
                 , Path::OutDir+"SPTHSV.EXE")
JP1/Script version

Supported from JP1/Script 01-00.