0

I want my python script to read the windows service description, In order to decide whether to stop it \ make it run only manually.. The point is that I don't find the method that reads the Description. (may be something like 'GetServiceDescription').

help anyone?

yuda41
  • 9
  • 1
  • 1
    what exactly are you trying to read? People wont get a clear idea and please let us know what have you tried so far ! – therealprashant Jul 08 '15 at 09:53
  • I'm looking for a method to read a service's description programmatically. – yuda41 Jul 08 '15 at 14:07
  • eg. the description of the GPO Service windows is: "The service is responsible for applying settings configured by administrators for the computer and users through the Group Policy component. If the service is stopped or disabled, the settings will not be applied and applications and components will not be manageable through Group Policy.." For each service in my pc I want to be able to read its description and then - manage it - startup status (automatically \ manual) etc. – yuda41 Jul 08 '15 at 14:16
  • So far, I've been using : win32service.OpenSCManager(None, None, win32service.SC_MANAGER_ALL_ACCESS) handle = win32service.OpenSCManager(None, None, win32service.SC_MANAGER_ALL_ACCESS) hs=win32service.OpenService(handle,"PeerDistSvc",win32service.SERVICE_ALL_ACCESS) – yuda41 Jul 08 '15 at 14:18

1 Answers1

1

You can use wmi library also follow other answers like List running processes on 64-bit Windows.

i haven't tested this but this should be the short snippet to list them reference,

import wmi
c = wmi.WMI()
for service in c.Win32_Service(): #if its win32
    print service.Name

Follow this tutorial

If you find it tough to follow may be looking at the tutorial may help or come again with another question.

Community
  • 1
  • 1
Ja8zyjits
  • 1,433
  • 16
  • 31