Sc queryex


Applies To: Windows Server 2008 R2,Windows Server 2008,Windows Server 2003 with SP1,Windows Server 2003,Windows Vista,Windows Server 2003 with SP2,Windows 7,Windows Server 2003 R2

Obtains and displays extended information about the specified service, driver, type of service, or type of driver.

For examples of how to use this command, see Examples.

Syntax


Copy Code

sc [<ServerName>] queryex [type= {driver | service | all}] [type= {own | share | interact | kernel | filesys | rec | adapt}] [state= {active | inactive | all}] [bufsize= <BufferSize>] [ri= <ResumeIndex>][group= {"" | <GroupName>}]

Parameters

Parameter

Description

<ServerName>

Specifies the name of the remote server on which the service is located. The name must use the Universal Naming Convention (UNC) format (for example, \\myserver). To run SC.exe locally, omit this parameter.

<ServiceName>

Specifies the service name returned by the getkeyname operation. This queryex parameter is not used in conjunction with any other queryex parameters except ServerName.

type= {driver | service | all}

Specifies what to enumerate. The default value for the first type is service.

Value

Description

driver

Specifies that only drivers are enumerated.

service

Specifies that only services are enumerated.

all

Specifies that both drivers and services are enumerated.

type= {own | share | interact | kernel | filesys | rec | adapt}

Specifies the type of services or type of drivers to enumerate. The default value for the second type is own.

Value

Description

own

The service runs in its own process. It does not share an executable file with other services.

share

The service runs as a shared process. It shares an executable file with other services.

interact

The service can interact with the desktop, receiving input from users. Interactive services must be run under the LocalSystem account.

kernel

Driver.

filesys

File system driver.

state= {active | inactive | all}

Specifies the started state of the service for which to enumerate. The default state is active.

Value

Description

active

Specifies all active services.

inactive

Specifies all paused or stopped services.

all

Specifies all services.

bufsize= <BufferSize>

Specifies the size (in bytes) of the enumeration buffer. The default buffer size is 1024 bytes.

ri= <ResumeIndex>

Specifies the index number at which to begin or resume the enumeration. The default value is 0.

group= <GroupName>

Specifies the service group to enumerate. By default, all groups are enumerated (group= "").

/?

Displays help at the command prompt.

Remarks


Copy Code

sc queryex bufsize= 2130 ri= 75

Examples

To display extended information about the MESSENGER service, type:


Copy Code

sc queryex messenger

To display extended information about all service groups, type:


Copy Code

sc queryex group= ""

Additional references

Command-Line Syntax Key