| Previous | Next |
| QUERY_E_INVALID_OUTPUT_COLUMN | QUERY_E_DIR_ON_REMOVABLE_DRIVE |
QUERY_E_INVALID_DIRECTORY
The directory query scope is invalid
QUERY_E_INVALID_DIRECTORY is HRESULT 0x8004160A. Windows documents it as “Invalid directory name.”
Exact contract boundary
This result belongs to legacy Windows query execution and is returned while converting a caller path, URL or virtual scope into a searchable catalog location. The exact condition is: a malformed, unresolvable or out-of-catalog directory identifier.
Input or state defects
A failed command or empty rowset is only the visible symptom; it does not identify which restriction, projection, sort, scope, timeout or catalog state violated the query contract.
Incident record
- Record original scope before releasing the relevant objects.
- Associate normalized scope with the exact UTC timestamp and correlation identifier.
- Compare failing and known-good values for path type under the same provider or handler version.
- Record the source and normalization path of catalog roots, not only its display form.
- Record provider command text and dialect before releasing the relevant objects.
Redact private literals if necessary, but keep clause boundaries, canonical properties, parameter types, dialect and parser or provider offsets.
How to isolate the cause
- Capture original scope and normalized scope at the call boundary that returns this result.
- Confirm the operation reached converting a caller path, URL or virtual scope into a searchable catalog location with the intended path type.
- record original and normalized forms, determine the API-required scope format and confirm catalog membership.
Begin with a known-good minimal command against the same catalog and restore projection, restriction, sorting, grouping and scope one component at a time.
Restoration strategy
Correct canonicalization or catalog configuration before retrying. Backoff helps only with measured transient load or timeout; it cannot repair invalid clauses, projection metadata, scopes or command state.
Scope of the result
It does not by itself prove catalog corruption, service outage, access denial or absence of matches; the query stage and provider records must identify the failing clause or state.
Comparison with adjacent codes
QUTIL_E_CANT_CONVERT_VROOT is specifically virtual-root conversion; QUERY_E_DIR_ON_REMOVABLE_DRIVE is media policy.
Developer and administrator guidance
Retain final command text, dialect, catalog generation, parameter values, timeout, cancellation state and chained OLE DB error records. Before rebuilding the catalog or restarting the provider, reproduce the minimal command and preserve its chained errors.
Example from a search pipeline
A web application sends /docs where a configured virtual or physical scope is required. Logging both forms reveals the missing translation.
Official Microsoft references
Looking for a different code? Search another status or error code.