\r
nssm list\r
\r
+To see all services on the system, not just NSSM's, use list all:\r
+\r
+ nssm list all\r
+\r
\r
Showing processes started by a service\r
--------------------------------------\r
for (int i = 0; i < argc; i++) SecureZeroMemory(argv[i], _tcslen(argv[i]) * sizeof(TCHAR));\r
exit(ret);\r
}\r
- if (str_equiv(argv[1], _T("list"))) exit(list_nssm_services());\r
+ if (str_equiv(argv[1], _T("list"))) exit(list_nssm_services(argc - 2, argv + 2));\r
if (str_equiv(argv[1], _T("processes"))) exit(service_process_tree(argc - 2, argv + 2));\r
if (str_equiv(argv[1], _T("remove"))) {\r
if (! is_admin) exit(elevate(argc, argv, NSSM_MESSAGE_NOT_ADMINISTRATOR_CANNOT_REMOVE));\r
return ret;\r
}\r
\r
-int list_nssm_services() {\r
+int list_nssm_services(int argc, TCHAR **argv) {\r
+ bool including_native = (argc > 0 && str_equiv(argv[0], _T("all")));\r
+\r
/* Open service manager. */\r
SC_HANDLE services = open_service_manager(SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE);\r
if (! services) {\r
\r
get_parameters(service, 0);\r
/* We manage the service if we have an Application. */\r
- if (service->exe[0]) _tprintf(_T("%s\n"), service->name);\r
+ if (including_native || service->exe[0]) _tprintf(_T("%s\n"), service->name);\r
\r
cleanup_nssm_service(service);\r
}\r
void CALLBACK end_service(void *, unsigned char);\r
void throttle_restart(nssm_service_t *);\r
int await_single_handle(SERVICE_STATUS_HANDLE, SERVICE_STATUS *, HANDLE, TCHAR *, TCHAR *, unsigned long);\r
-int list_nssm_services();\r
+int list_nssm_services(int, TCHAR **);\r
int service_process_tree(int, TCHAR **);\r
\r
#endif\r