def QueryService(svc_name):
 hscm = win32service.OpenSCManager(None, None, win32service.SC_MANAGER_ALL_ACCESS)
 result = None
 try:
  hs = win32serviceutil.SmartOpenService(hscm, svc_name, win32service.SERVICE_ALL_ACCESS)
  result = win32service.QueryServiceConfig(hs)
  win32service.CloseServiceHandle(hs)
 finally:
  win32service.CloseServiceHandle(hscm)
 return result

def QueryService ( svc_name ) : hscm = win32service . OpenSCManager ( None , None , win32service . SC_MANAGER_ALL_ACCESS ) result = None try : hs = win32serviceutil . SmartOpenService ( hscm , svc_name , win32service . SERVICE_ALL_ACCESS ) result = win32service . QueryServiceConfig ( hs ) win32service . CloseServiceHandle ( hs ) finally : win32service . CloseServiceHandle ( hscm ) return result
query service and get its config .