listing existing windows services with python

Brian Curtin brian.curtin at gmail.com
Tue Feb 16 00:13:45 EST 2010


On Mon, Feb 15, 2010 at 18:17, Alf P. Steinbach <alfps at start.no> wrote:

> * News123:
>
>  Hi,
>>
>>
>> What is the best way with python to get a list of all windows services.
>>
>> As a start I would be glad to receive only the service names.
>>
>> However it would be nicer if I could get all the properties of a service
>> as well.
>>
>> Thanks for any info and bye
>>
>
>
> * Registry functions:
>
>  Otherwise, I'd use the general registry access functions.
>
>  Info about the registry access functions is available in your Python docs.
>
>  All the information about services is in the Windows registry (documented
> in
>  the MSDN Library, which is available in a browsable on-line version at
>  Microsoft).
>

As for doing this via the registry, take a look at the EnumKey and EnumValue
functions of the winreg module (_winreg in 2.x).
HKLM\System\CurrentControlSet\Services contains service information, and
iterating over that should get a lot of what's needed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100215/63cf619b/attachment.html>


More information about the Python-list mailing list