[python-win32] Listing Win32 services

Tim Golden tim.golden at viacom-outdoor.co.uk
Mon Jun 30 17:41:32 EDT 2003


Try using wmi and then checking Win32_Service.

http://tgolden.sc.sabren.com/python/wmi.html

You'll want something like this:

c = wmi.WMI ()
for s in c.Win32_Service:
  print s.Name

HTH
TJG

-----Original Message-----
From: Moore, Paul [mailto:Paul.Moore at atosorigin.com]
Sent: 30 June 2003 16:40
To: Python Win32 (E-mail)
Subject: [python-win32] Listing Win32 services


I've searched the win32all documentation, and I can't find a way
of listing all of the services on a machine. The API call would be
EnumServicesStatus(Ex), but win32all doesn't seem to wrap that one.
I'm trying to write something a bit like the resource kit "sclist"
command - a list of services, one per line, plus the service status
(stopped, started, whatever).

Have I missed something, or am I going to have to do something
low-level with ctypes?

Paul.

_______________________________________________
Python-win32 mailing list
Python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-win32 mailing list