Name
OpenSCManager( )
Synopsis
Establishes a connection to the Service Control Manager on the specified computer and opens the specified SCM database.
handle = OpenSCManager(machineName, databaseName, desiredAccess)
Parameters
-
machineName Names the target computer. If
Noneor an empty string, the function connects to the local computer.-
databaseName Names the SCM database to open. If
None, the databaseSERVICES_ACTIVE_DATABASEis used.-
desiredAccess Specifies the access to the SCM. Any or all of the following flags can be used. The value
win32service.SC_MANAGER_CONNECTis implied.-
win32service.SC_MANAGER_ALL_ACCESS Includes
STANDARD_RIGHTS_REQUIRED, plus the access types in this list.-
win32service.SC_MANAGER_CONNECT Enables connecting to the SCM.
-
win32service.SC_MANAGER_CREATE_SERVICE Enables calling the
win32service.CreateService()function to create a service and add it to the database.-
win32service.SC_MANAGER_ENUMERATE_SERVICE Enables calling the
win32service.EnumServicesStatus()function to list the services in the database.-
win32service.SC_MANAGER_LOCK Enables calling the
win32service.LockServiceDatabase()function to acquire a lock on the database.-
win32service.SC_MANAGER_QUERY_LOCK_STATUS Enables calling the
win32service.QueryServiceLockStatus()function to retrieve the lock status information for the database.
The following access types can also be used.
-
win32con.GENERIC_READ Combines the following access types:
STANDARD_RIGHTS_READ,SC_MANAGER_ENUMERATE_SERVICE, andSC_MANAGER_QUERY_LOCK_STATUS ...
-
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access