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[source]

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

enum_flags

Lazy computed at first enum

get_service(key, access=MAXIMUM_ALLOWED(0x2000000))[source]

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)[source]

Represent a service on the system

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)[source]

Start the service

Parameters:

args – a list of str

property status

The status of the service

Type:

SERVICE_STATUS_PROCESS

stop()[source]

Stop the service

value

current value