| Previous | Next |
| ERROR_CANT_ACCESS_FILE | RPC_S_ENTRY_TYPE_MISMATCH |
ERROR_CANT_RESOLVE_FILENAME
The file name cannot be resolved by the system.
ERROR_CANT_RESOLVE_FILENAME is Win32 error 1921 (0x781). Name resolution can involve relative-path context, drive mappings, UNC providers, symbolic links, mount points, reparse points, short names, shell search behavior, and normalization rules. The status means the naming chain did not produce a target suitable for the operation, which is different from reaching a known file and then being denied access.
Why name resolution breaks
- a relative path is evaluated under an unexpected current directory or service session
- a mapped drive exists only in another user’s interactive logon session
- a symbolic link, mount point, DFS link, or other reparse target is missing or malformed
- the path contains unsupported syntax, an incomplete UNC name, or a component no provider recognizes
- rename, replacement, offline namespace state, or provider failure changes the target during resolution
Name-resolution evidence
Capture the original path, whether it is relative, current directory, process and user session, expanded environment values, drive mapping, normalized full path, reparse tags encountered, network provider, and the API performing resolution. Redact user and document names where necessary, but retain component boundaries and path type. Record path bytes or Unicode code points only in secure diagnostics when invisible characters are suspected.
Diagnostic sequence
Convert relative input to an absolute path under controlled rules and verify each path component. Inspect drive mappings in the service’s own session, not the administrator’s desktop. Resolve reparse points and UNC components step by step and check that the intended provider is available.
Avoid using shell search functions when the contract requires a precise file path. If the name comes from a shortcut, manifest, registry value, or protocol, inspect the authoritative source before normalizing it. Reproduce while monitoring rename and namespace-provider events when the failure is intermittent.
Correction and robust path handling
Use an absolute canonical path or a documented provider-specific name, restore missing namespace links, and make required shares or volumes available in the caller’s context. Replace mapped-drive dependencies in services with explicit UNC paths where appropriate.
Applications should define the accepted path syntax, avoid changing the process current directory concurrently, preserve Unicode names, and open by handle as early as possible. Do not repeatedly guess alternate paths after 1921 because that can select the wrong file.
Difference from file not found and access failure
ERROR_FILE_NOT_FOUND reports that a resolved location has no matching file in common file APIs. ERROR_CANT_ACCESS_FILE reports an access problem. Error 1921 highlights failure to resolve the name or naming chain itself.
Example
A Windows service receives Z:\reports\daily.dat, but drive Z exists only in the operator’s desktop session. The service returns 1921 because it cannot resolve that mapping. Supplying the authenticated UNC path fixes the namespace dependency.
References
- Microsoft: System Error Codes (1700–3999)
- Microsoft: Win32 Error Codes in MS-ERREF
- Microsoft: GetFullPathName
- Microsoft: GetFinalPathNameByHandle
Looking for a different code? Search another status or error code.
