wntSvcList

Return lists of service names that meet the specified search criteria.

Syntax:

wntSvcList(server-name, service/group-name, flags)

Parameters:

(s) server-name: the UNC name of the server on which the function will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate the current machine.

(s) service/group-name: a service name or a service group name. See below for more information.

(i) flags: a numeric value that controls how this function works. See below for more information.

Returns:

(s) list: a tab delimited list of service names and service states that match the search criteria specified.

 

This function can return lists of service names that meet the specified search criteria.

On WinNT [and newer], all services of a certain type [e.g. device drivers, application services, or both device drivers & application services] and in a certain state [active, inactive, or both active & inactive] may be listed. The service/group-name parameter should be an empty string to list services in this manner.

On WinNT [and newer], all services that are dependent upon a specified service may be listed. The service/group-name parameter should contain the name of the specified service which must appear in the dependencies list other service which will have their names returned by this function. The list of services that are dependent on the specified service may be qualified by service state in the same way as is done when simply listing all of the services on a system, but the service type will be ignored [if one is specified].

On Win2K [and newer], all services belonging to a specified service group may be listed. The value of the service/group-name parameter should be a valid service group name and must have a leading "+" at the beginning of the name. Only services belonging to this service group will be returned. To list services that do not belong to any group at all, specify the value of service/group-name as "+". Again, the list of services may be qualified by service type and service state in the same was as is done when simply listing all of the services on a system.

In all cases, the list of services that are returned will be a TAB delimited list of pairs of values where each pair is "service-name|service-state". Refer to the help text for, request #2 [current state] for a description of the numeric values that represent the various service states. Service names will be returned regardless of whether the value of service/group-name was a service name, service display name, service group name or an empty string.

The following values are valid for the flags parameter. The flags parameter value will consist of a series of values added together, with one value coming from each of the following 3 groups of values.

 

Flag value

Meaning

flag group #1

service types

1

application services

2

device drivers

3

both application services & device drivers

flag group #2

service states

100

active services

200

inactive services

300

both active and inactive services

flag group #3

service/group-name is the following type of service name

Note: The values for flag group #3 [0 and 1000] only apply when the "service/group-name" parameter contains an actual service name [either display name or key name]. This flag does not control the format in which service names are returned.

0

display name [as shown in the control panel services applet or in services.msc]

1000

service name [actual service registry key name]

 

 

 

Example:
; Load Appropriate Extender
AddExtender('wwwnt34i.dll',0,'wwwnt64i.dll')

grp1 = 3; both application services & device drivers grp2 = 300; both active and inactive services grp3 = 0; only applys if "service/group-name" contains a service name flag = grp1 + grp2 + grp3 list = wntSvcList( "", "", flag) AskItemlist("List of all Services and Device drivers", list,@TAB, @UNSORTED, @SINGLE) Exit
See Also:

wntSvcControl, wntSvcStatus