# 2.8. Service — PythonForWindows 1.0.3 documentation

# 2.8. Service

The services manager is accessible via `windows.system.services`

Note

See sample windows.system & Services

## 2.8.1. ServiceManager

class windows.winobject.service.ServiceManager

  Bases: `AutoHandle`

  An object to query, list and explore services

  __getitem__(key, access=MAXIMUM_ALLOWED(0x2000000))

    Get a service by its name/index or a list of services via a slice

    Returns:

      `Service` or [`Service`] – A `Service` or list of `Service`

  __iter__(flags=None)

    Iter over the services on the system

    Yield:

      `Service`

  create(name, description, access, type, start, path, user=None)

    Create a new service

    Returns:

      `Service` – The newly created service

  enum_flags

    Lazy computed at first enum

  get_service(key, access=MAXIMUM_ALLOWED(0x2000000))

    Get a service by its name/index or a list of services via a slice

    Returns:

      `Service` or [`Service`] – A `Service` or list of `Service`

  property handle

    An handle on the object

    Type:

      HANDLE

      Note

      The handle is automaticaly closed when the object is destroyed

  wait(timeout=INFINITE(0xffffffff))

    Wait for the object

## 2.8.2. Service

class windows.winobject.service.Service(handle, name, description=None)

  Represent a service on the system

  delete()

    Delete the service

  property description

    The description of the service

    Type:

      `str`

  from_param()

    Convert a Python object into a function call parameter.

  name

    The name of the service

    Type:

      `str`

  property process

    The process running the service (if any)

    Type:

      `WinProcess` or `None`

  property security_descriptor

    The security descriptor of the service

    Type:

      `SecurityDescriptor`

  start(args=None)

    Start the service

    Parameters:

      args – a list of `str`

  property status

    The status of the service

    Type:

      `SERVICE_STATUS_PROCESS`

  stop()

    Stop the service

  value

    current value