ChangeServiceConfig Method

The ChangeServiceConfig function changes the configuration parameters of the service.  

BOOL ChangeServiceConfig(
 LPCTSTR DisplayName,
 LPCTSTR Description,
 LPCTSTR BinaryPathName,
 LPCTSTR LoadOrderGroup,
 LPCTSTR Dependencies,
 LPCTSTR ServiceStartName,
 LPCTSTR Password,
 BOOL InteractWithDesktop,
 LONG StartType
);


Parameters
  DisplayName     [in] Pointer to a null-terminated string that contains the display name to be used by applications to identify the service for its users. This string has a maximum length of 256 characters. The name is case-preserved in the service control manager. Display name comparisons are always case-insensitive.   Description     [in] Pointer to a null-terminated string that specifies the description of the service. If this value is NULL, the description remains unchanged. If this value is an empty string (""), the current description is deleted.       [in] Pointer to a null-terminated string that contains the fully qualified path to the service binary file. Specify NULL if you are not changing the existing path. If the path contains a space, it must be quoted so that it is correctly interpreted. For example, "d:\\my share\\myservice.exe" should be specified as "\"d:\\my share\\myservice.exe\"".   LoadOrderGroup     [in] Pointer to a null-terminated string that names the load ordering group of which this service is a member. Specify NULL if you are not changing the existing group. Specify an empty string if the service does not belong to a group.   LoadOrderGroup     [in] Pointer to a null-terminated string that names the load ordering group of which this service is a member. Specify NULL if you are not changing the existing group. Specify an empty string if the service does not belong to a group.   Dependencies     [in] Pointer to a double null-terminated array of null-separated names of services or load ordering groups that the system must start before this service can be started. (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.) Specify NULL if you are not changing the existing dependencies. Specify an empty string if the service has no dependencies.   ServiceStartName     [in] Pointer to a null-terminated string that specifies the name of the account under which the service should run. Specify NULL if you are not changing the existing account name. Use an account name in the form DomainName\UserName.   Password     [in] Pointer to a null-terminated string that contains the password to the account name specified by the ServiceStartName parameter. Specify an empty string if the account has no password or if the service runs in the LocalService, NetworkService, or LocalSystem account.   InteractWithDesktop     [in] The service can interact with the desktop.   StartType     [in] Service start options. Specify RSA_SERVICE_NO_CHANGE if you are not changing the existing start type; otherwise, specify one of the following values.

TypeMeaning
RSA_SERVICE_AUTO_STARTA service started automatically by the service control manager during system startup.
RSA_SERVICE_DEMAND_STARTA service started by the service control manager when a process calls the StartService function.
RSA_SERVICE_DISABLEDA service that cannot be started. Attempts to start the service result in the error code ERROR_SERVICE_DISABLED


Return Values
  If the function succeeds, the return value is nonzero.