Command Reference

Create Service

Create a service on the local system.

NOTE: This action only works on Windows NT/2000/XP and has no effect on Windows 9x/ME. For more information about services, please read a book on the subject or search for more information online. You should not haphazardly experiment with the services on your or anyone else's system as this could cause major problems with the operating system. The service actions were put into this product for those who know how to use them and require their functionality.

Action ID: 63
Action Category: Services

Settings

Service

File name:

The fully qualified path to the service binary file.

Display name:

The localizable string that user interface programs use to identify the service. The string has a maximum length of 256 characters. The service control manager preserves the case of the display name, but display name comparisons are case insensitive.

Key name:

The string that gives the service name to install. The string has a maximum length of 256 characters. The service control manager database preserves the case of the characters in the service name, but comparisons of service names are case insensitive. Forward slashes (/) and backslashes (\) are invalid service name characters.

Start name:

The name that the service will be logged on as. If the service type is SERVICE_WIN32_OWN_PROCESS use an account name in the form: DomainName\UserName. If the account belongs to the built-in domain it is permitted to specify .\UserName. The LocalSystem account must be used if the type of service is SERVICE_WIN32_SHARE_PROCESS. To specify the LocalSystem account to Setup Factory, use "LocalSystem" (no quotes) or just leave this field blank (recommended).

Password:

The password for the account name in the Start name field. The service will have no password if Start name is empty. The start name of LocalSystem is NULL, and therefore the password for Start name in this instance is empty, so most services will leave this field blank.

Type Information

Service type:

Type of service. You must specify one of the following service types:

SERVICE_WIN32_OWN_PROCESS - Specifies a Win32-based service that runs in its own process.

SERVICE_WIN32_SHARE_PROCESS - Specifies a Win32-based service that shares a process with other services.

SERVICE_KERNEL_DRIVER - Specifies a driver service.

SERVICE_FILE_SYSTEM_DRIVER - Specifies a file system driver service.

If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS, you can also optionally specify the Allow desktop interaction option below.

Allow desktop Interaction:

Enables a Win32-based service process to interact with the desktop. Valid only when SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS is specified as the Service type.

Start type:

Specifies when to start the service. You must specify one of the following start types:

SERVICE_BOOT_START - Specifies a device driver started by the system loader at the earliest possible point in the system boot process. This value is valid only for driver services, and is usually reserved for very low-level device drivers that deal with key operating system components, such as file system drivers.

SERVICE_SYSTEM_START - Specifies a device driver started by the IoInitSystem function, which is called during the second part of the boot process known as the "System" phase. This value is valid only for driver services. (Most device drivers start during the System phase.)

SERVICE_AUTO_START - Specifies a service to be started automatically by the service control manager during the final part of the system boot process, known as the "Auto" phase. (This happens about the same time as you see the Windows logon screen.)

SERVICE_DEMAND_START - Specifies a service to be started on demand by the service control manager when a process calls the Start function.

(More info)

SERVICE_DISABLED - Specifies a service that can no longer be started.

Error control:

Specifies the severity of the error if this service fails to start during startup, and determines the action taken by the startup program if failure occurs. You must specify one of the following values.

SERVICE_ERROR_IGNORE - The startup program logs the error in the system's event log and continues with system startup. (Services that are started on demand should always have Error control set to SERVICE_ERROR_IGNORE.)

SERVICE_ERROR_NORMAL - The startup program logs the error in the system's event log, puts up a message box to alert the user about the error, and continues with system startup.

SERVICE_ERROR_SEVERE - The startup program logs the error in the system's event log. If the last-known-good configuration is being started, the startup operation continues. Otherwise, the system is automatically restarted with the last-known-good configuration.

SERVICE_ERROR_CRITICAL - The startup program logs the error in the system's event log (if possible). If the last-known-good configuration is being started, the startup operation fails. Otherwise, the system is automatically restarted with the last-known good configuration.

Groups

Load order group:

The name of the load ordering group of which this service is a member. Leave this field empty if the service does not belong to a group.

(More info)

Dependencies (';;' deliminated list):

A double-semi-colon delimited list of names of services or load order groups that the system must start before this service. Leave this field empty if the service has no dependencies. Dependency on a group means that this service can run if at least one member of the group is running after an attempt to start all members of the group.

Return Values

Value
(%LastErrorNum%)

Simple Message
(%LastErrorMsg%)

Verbose Message
(%LastErrorDetails%)

0 (OK)

 

 

1

Failed to create service.

Iterate services failed.
<<Display Name>>
<<Key Name>>

2

Failed to create service.

Query service failed.
<<Display Name>>
<<Key Name>>

3

Failed to create service.

 Command failed.
<<Display Name>>
<<Key Name>>

Example

None available.

 

See Also: Alphabetical List of Actions, Categorical List of Actions, On Error tab