listing existing windows services with python
news123 at free.fr
Wed Feb 17 10:21:55 CET 2010
Thanks a lot.
As I have pywin32 already installed this is probbaly the way to go.
Meanwhile I implemented already a small module, which is parsing
sc.exe's output, but probably 'll change it as my implementation is a
David Bolen wrote:
> alex23 <wuwei23 at gmail.com> writes:
>> News123 <news... at free.fr> wrote:
>>> 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.
>> I highly recommend Tim Golden's fantastic WMI module.
> Another alternative is the win32service module from the pywin32
> package (which IMO you'll almost certainly want available when doing
> any significant Windows-specific operations) which wraps the native
> win32 libraries for enumerating, querying and controlling services.
> A simple loop could use EnumServicesStatus to iterate through the
> services, OpenService with the SERVICE_QUERY_CONFIG flag to get a
> handle to each service, and then QueryServiceConfig to retrieve
> configuration information.
> Since pywin32 is a relatively thin wrapper over the win32 libraries,
> pure MSDN documentation can be used for help with the calls, augmented
> by any Python-related information contained in the pywin32
> -- David
More information about the Python-list