5

Currently sc query shows service name, display name and other attributes of the services installed on my box. However it does not tell me what the Log on as setting is. How can I get this information using the command line?

  • Unless you are running SQL server or Exchange, all your services are going to be running either NetworkService, LocalService or LocalSystem. It isn't necessary to learn the differences to them, but if you really really want to, technet would be the place to start. – surfasb Jul 26 '11 at 20:59
5

sc query queries the current state; use sc qc to read the configuration.

C:\>sc qc messenger
[SC] GetServiceConfig SUCCESS

SERVICE_NAME: messenger
        TYPE               : 20  WIN32_SHARE_PROCESS
        START_TYPE         : 4   DISABLED
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\WINDOWS\system32\svchost.exe -k netsvcs
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : Messenger
        DEPENDENCIES       : LanmanWorkstation
                           : NetBIOS
                           : PlugPlay
                           : RpcSS
        SERVICE_START_NAME : LocalSystem
9

You can use "WMIC" (WMI Command Line Interface) for this:

wmic service where name="Power" get StartName

StartName LocalSystem

Here's an example for a different service:

wmic service where name="RpcSS" get StartName

StartName NT AUTHORITY\NetworkService

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.