NAnt SDK Documentation - v0.92

ServiceControllerTask Class

Allows a Windows service to be controlled.

For a list of all members of this type, see ServiceControllerTask Members.

System.Object
   NAnt.Core.Element
      NAnt.Core.Task
         NAnt.MSNet.Tasks.ServiceControllerTask

[Visual Basic]
<TaskName(Name:="servicecontroller")>
Public Class ServiceControllerTask
    Inherits Task
[C#]
[TaskName(Name="servicecontroller")]
public class ServiceControllerTask : Task

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Example

Starts the World Wide Web Publishing Service on the local computer.

    
<servicecontroller action="Start" service="w3svc" />
    
  

Stops the Alerter service on computer 'MOTHER'.

    
<servicecontroller action="Stop" service="Alerter" machine="MOTHER" />
    
  

Requirements

Namespace: NAnt.MSNet.Tasks

Assembly: NAnt.MSNetTasks (in NAnt.MSNetTasks.dll)

See Also

ServiceControllerTask Members | NAnt.MSNet.Tasks Namespace