DisplayName: Service display name.\r
ImagePath: Path to the service executable.\r
ObjectName: User account which runs the service.\r
+ Name: Service key name.\r
Start: Service startup type.\r
Type: Service type.\r
\r
nssm set <servicename> AppExit 2 Exit\r
\r
\r
+The Name parameter can only be queried, not set. It returns the service's\r
+registry key name. This may be useful to know if you take advantage of\r
+the fact that you can substitute the service's display name anywhere where\r
+the syntax calls for <servicename>.\r
+\r
+\r
The ObjectName parameter requires an additional argument only when setting\r
a username. The additional argument is the password of the user.\r
\r
\r
nssm remove UT2004 confirm\r
\r
+To find out the service name of a service with a display name:\r
+\r
+ nssm get "Background Intelligent Transfer Service" Name\r
+\r
\r
Building NSSM from source\r
-------------------------\r
return ret;
}
+int native_set_name(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {
+ print_message(stderr, NSSM_MESSAGE_CANNOT_RENAME_SERVICE);
+ return -1;
+}
+
+int native_get_name(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {
+ return value_from_string(name, value, service_name);
+}
+
int native_set_objectname(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {
SC_HANDLE service_handle = (SC_HANDLE) param;
if (! service_handle) return -1;
{ NSSM_NATIVE_DISPLAYNAME, REG_SZ, NULL, true, 0, native_set_displayname, native_get_displayname },
{ NSSM_NATIVE_IMAGEPATH, REG_EXPAND_SZ, NULL, true, 0, native_set_imagepath, native_get_imagepath },
{ NSSM_NATIVE_OBJECTNAME, REG_SZ, NSSM_LOCALSYSTEM_ACCOUNT, true, ADDITIONAL_SETTING, native_set_objectname, native_get_objectname },
+ { NSSM_NATIVE_NAME, REG_SZ, NULL, true, 0, native_set_name, native_get_name },
{ NSSM_NATIVE_STARTUP, REG_SZ, NULL, true, 0, native_set_startup, native_get_startup },
{ NSSM_NATIVE_TYPE, REG_SZ, NULL, true, 0, native_set_type, native_get_type },
{ NULL, NULL, NULL, NULL, NULL }