Skip to content

Service_Create

Creates a Windows service with the specified name, display name and executable.

Service_Create(sServiceName, sDisplayName, sBinPath) As Boolean

Name of the service. Use the service name, for example Spooler, not the display name.

Display name of the service, as shown in the Services console

Full path of the service executable, including any command-line arguments

The function returns False if Windows can’t create the service, for example because a service with the same name already exists. giErrorCode contains the return code from Windows, and the package log shows its meaning.

If bStatus Then bStatus = Service_Create("ServiceName", "DisplayName", "C:\CapaInstaller.exe")

Scripting Guidelines

Service_Delete Service_Exist Service_SetStartMode Service_Start Constants Package Property Variables