Pcornel
Windows · Windows Services

Services

Cheat sheet · https://pcornel.dk/topic.php?topic=3016

Back to the Topic

Answer

A Windows service is a background program that conforms to the Service Control Manager lifecycle interface. It can be started at boot, on demand or by triggers and can continue running without an interactive user session.

Remember

  • Service name and display name are distinct identifiers.
  • A service can run in its own process or share a host process with other services.
  • RUNNING is lifecycle state, not application health.
  • A service may accept stop/pause controls only if implemented/configured to do so.
  • A service process exiting can change one or multiple service states depending on hosting.

First checks

  • Get-Service <name> | fl * — status, start type, dependencies
  • Get-CimInstance Win32_Service -Filter "Name='<name>'" | Select StartName,PathName,StartMode — account, path and mode
  • sc.exe qc <name> — configuration in CMD
  • Get-WinEvent -FilterHashtable @{LogName='System';ProviderName='Service Control Manager'} -MaxEvents 20 — SCM events

Verify in this order

service configured → started by SCM → runs in a process → stops or fails

Where it usually breaks

First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.

Windows Services → Services reference map

ItemMeaningEvidence boundary
Service nameStable management key/nameused by many CLI/API operations
Display nameFriendly UI namenot always accepted where service name is required
StateLifecycle statusSTOPPED/RUNNING/pending/paused etc.
PID/hostRuntime processmay host one or many services
FunctionConsumer-visible capabilitymust be verified separately

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3016

Confirmation

Confirm action

Continue?