Pcornel
Browse topics
Options
Recent
Favorites
Command · Windows / Windows Server / PowerShell

sc.exe query <service>

sc.exe query <service>

Shows the state of a Windows service: running, stopped or pending, and its exit code.

Execution context

Standard user

Use when

A service will not start, or hangs in START_PENDING.

Privilege Standard userState impact Read-onlyProduction Unknown

Operational impact: Read-only.
Command detailsSafety model · family · platform · verification · bundle
PrivilegeStandard user
Execution contextStandard user
State impactRead-only
Safe during productionUnknown
CategoryServices
Evidence levelmixed
Primary DomainWindows
Historical technical verificationNeeds verification dateCurrent command content requires review after a Git edit.
Family Ervices
PlatformWindows / Windows Server / PowerShell
PrerequisiteStandard user
Output fields

Field glossary

Important fields projected from persisted Command guidance.

SERVICE_NAME, TYPE, STATE, WIN32_EXIT_CODE, SERVICE_EXIT_CODE, CHECKPOINT, WAIT_HINT

Important persisted output field; use surrounding guidance for interpretation.

Command → Topic semantics

Used in these Topics

Each relation carries both placement role and operational semantic: verifies, configures, troubleshoots, collects evidence, changes state or general.

DomainsWindows

Find another Command

Reference enrichment

Evidence boundary

What this output can establish — and where you must not over-claim.

Proves

Shows the current state and last exit code of the service.

Does not prove

Does not explain why the service failed; the System event log usually does.

Next check

Check the configuration with sc.exe qc <service> and the System log (Service Control Manager events).

Depth when you need it

Command guidance

Execution context

Standard user

Use when

A service will not start, or hangs in START_PENDING.

Important fields

SERVICE_NAME, TYPE, STATE, WIN32_EXIT_CODE, SERVICE_EXIT_CODE, CHECKPOINT, WAIT_HINT

Common problems

stuck in START_PENDING or STOP_PENDING; non-zero exit code

Operational impact

Read-only.

Technical context

In PowerShell write sc.exe, because "sc" is an alias for Set-Content. Use the service name, not the display name.

Confirmation

Confirm action

Continue?