Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
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

2 Answers 2

up vote 2 down vote accepted

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
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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