You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
579 B
24 lines
579 B
import win32service
|
|
import win32con
|
|
|
|
|
|
def EnumServices():
|
|
resume = 0
|
|
accessSCM = win32con.GENERIC_READ
|
|
accessSrv = win32service.SC_MANAGER_ALL_ACCESS
|
|
|
|
#Open Service Control Manager
|
|
hscm = win32service.OpenSCManager(None, None, accessSCM)
|
|
|
|
#Enumerate Service Control Manager DB
|
|
|
|
typeFilter = win32service.SERVICE_WIN32
|
|
stateFilter = win32service.SERVICE_STATE_ALL
|
|
|
|
statuses = win32service.EnumServicesStatus(hscm, typeFilter, stateFilter)
|
|
for (short_name, desc, status) in statuses:
|
|
print(short_name, desc, status)
|
|
|
|
|
|
EnumServices()
|