ERROR_FILE_NOT_FOUND - 2 (0x2)

The system cannot find the file specified.

Updated: Feb 21, 2026

Technical Meaning

The error code ERROR_FILE_NOT_FOUND (2) indicates that the system was unable to locate a file specified in an operation. This is a generic return value used by various APIs and functions within the Windows operating system.

Error Details

  • Error Name: ERROR_FILE_NOT_FOUND
  • Numeric Code: 2
  • Hex Code: 0x2
  • Short Description: The system cannot find the file specified.

This error typically occurs when a program or service attempts to access a file that does not exist at the specified path. It can be returned by functions such as CreateFile, ReadFile, and others that require file handles.

Usage Context

The context in which this error is generated depends on the specific API call being made. For example, if an application tries to open a non-existent file using CreateFile, it will return ERROR_FILE_NOT_FOUND. Similarly, attempting to read from or write to a file that does not exist will also result in this error.

Developer Interpretation

When encountering ERROR_FILE_NOT_FOUND, developers should consider the following:

  • Verify that the file path is correct and the file exists at the specified location.
  • Ensure that any necessary directories are present and accessible.
  • Check for typos or incorrect naming conventions in the file name.
  • Confirm that the application has sufficient permissions to access the file.

Related Errors

  • ERROR_PATH_NOT_FOUND (3): Indicates that a path specified in an operation does not exist.
  • ERROR_ACCESS_DENIED (5): Occurs when the application lacks the necessary permissions to access the file or directory.
  • ERROR_INVALID_PARAMETER (87): Suggests that one of the parameters passed to the API is invalid, which could include a non-existent file path.

FAQ

Q: What does ERROR_FILE_NOT_FOUND mean?

A: It means that the system was unable to locate the specified file. This can occur due to incorrect paths or missing files.

Q: How do I resolve this error?

A: Ensure that the file path is correct and the file exists at the specified location. Verify the application's permissions and check for any typos in the file name.

Summary

ERROR_FILE_NOT_FOUND (2) is a generic return code indicating that the system could not find the specified file. Developers should verify paths, ensure files exist, and confirm proper permissions when encountering this error.