wntSvcControl

Stops or controls a service.

Syntax:

wntSvcControl(server, service-name, flags, control-code)

Parameters:

(s) server-name: the UNC name of the server on which the function will execute (e.g., "\\MYSERVER"), or ("") for the local computer.

(s) service-name: the name of the service to be looked for.

(i) flags: specifies the type of name that "service-name" represents:
0  display name (the name shown in Control Panel)
1000 service name (the actual registry key name)

(i) control code: specifies the operation to be performed. See below.

Returns:

(i) returns 1.

 

Control codes:

Value

Name

Meaning

1

SERVICE_CONTROL_STOP

Requests the service to stop.

2

SERVICE_CONTROL_PAUSE

Requests the service to pause.

3

SERVICE_CONTROL_CONTINUE

Requests the paused service to
resume.

4

SERVICE_CONTROL_INTERROGATE

Requests the service to update
immediately its current status
information to the service control
manager.

 

Or it can be a user-defined control code in the range of 128 to 255, inclusive.

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

wntSvcControl("", "Spooler", 0, 1) ; stop the Spooler service Exit
See Also:

wntSvcStart