Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

Handles

Direct answer

A handle is a value a process uses to refer to an object managed by Windows, such as a file, registry key, event, mutex, process, thread, token or section. The handle is meaningful in the context of the process handle table and carries granted access rights.

When to use this

Use Handles when a file cannot be renamed/deleted because something has it open, when a process appears to leak resources, or when you need to identify which process has a specific object open.

First 30 seconds

1. Handle count: Get-Process -Id <pid> | Select Handles.

2. Growing over time → leak.

3. Which handles: handle.exe -p <pid> (Sysinternals).

4. File locked → handle.exe <filename>.

5. Restart the leaking app; report the leak.

Operational verification

process opens objects (files, keys, events) → handles in its table → closed when done

Evidence · next step

Check access/share semantics and reproduce whether releasing/closing the owning operation changes the symptom.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common traps

Do not close arbitrary handles in a production process just because a tool allows it; the application may depend on that object and can crash or corrupt its internal state. Prefer identifying the owner and correcting the application/workflow or using a controlled restart.

Platform / version applicability
Windows execution, automation and observability
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformWindows execution, automation and observability
Scope / prerequisiteUse Handles when a file cannot be renamed/deleted because something has it open, when a process appears to leak resourc…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

For a locked file, search for the file path/object in Process Explorer and confirm the process instance. For a suspected leak, record handle count over a representative interval and inspect which object type grows. Correlate growth with a repeatable operation before assigning causation.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • A handle value is process-relative; the same numeric value in another process can refer to a different object.
  • Open handles keep references to objects until they are closed/released.
  • Handles have access rights, so having a handle does not imply unrestricted access.
  • Some handles can be inherited by child processes when both creation and inheritance settings allow it.
  • A steadily increasing handle count can indicate a leak, but the object types and workload must be checked.
Key checks
  • Get-Process | Sort CPU -Desc | Select -First 10 Name,Id,CPU,WS — top processes
  • Get-CimInstance Win32_Process -Filter "ProcessId=<pid>" | Select Name,ParentProcessId,CommandLine — command line and parent
  • tasklist /v — processes with user and status
  • taskkill /PID <pid> /T — stop a process tree
ReferenceWhat it is1 section · depth on demand

Core model

Windows exposes many kernel-managed objects through handles. Applications obtain handles when they open/create objects and should close them when no longer needed. Because handles are part of the process runtime context, abrupt termination generally releases them when the process is torn down, but that is recovery rather than root-cause analysis.

ReferenceImportant terms & boundaries2 sections · depth on demand

Runtime / control boundary

Handle inheritance is controlled; a child does not simply inherit every resource of the parent. An inherited handle references the same underlying object, which is why redirected standard input/output, pipes and other interprocess patterns can depend on inheritance. The process tree alone does not tell you which handles were inherited.

In depth

A handle is a process's reference to a kernel object (file, registry key, event, mutex, process, thread, section). Leaks (handle counts growing without bound) eventually exhaust memory or limits.

Get-Process | Sort Handles -Desc | Select -First 10 Name,Id,Handles
handle.exe -p 1234 -s           # Sysinternals: summary by type
handle.exe C:\Data\locked.xlsx  # who holds a file open

A process with 100 000+ handles is suspicious. Files that cannot be deleted ("in use") are found with handle.exe or Resource Monitor → CPU → Associated Handles.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docWindows execution, automation and observability current

Authoritative/upstream documentation reviewed for bounded claims in Processes → Handles. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/windows/win32/procthread/process-and-thread-functions · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
windows handlesfile locked by processhandle leak windowsprocess explorer handles
Embedded reference data

Quick lookup tables

Processes → Handles reference map

Fast lookup boundaries for Processes → Handles.

ItemMeaningEvidence boundary
Handle valueProcess-local referenceinterpret only with owning PID
Object typeFile/process/thread/event/etc.narrows what resource is referenced
Object nameNamed path/object when exposedlinks runtime reference to resource
Granted accessRights on the handlewhat operations this reference allows
Handle countAggregate process metrictrend/object mix needed before calling it a leak
Confirmation

Confirm action

Continue?