ERROR_BAD_FILE_TYPE - 222 (0xDE)

The file type being saved or retrieved has been blocked.

Updated: Feb 21, 2026

Technical Meaning

The ERROR_BAD_FILE_TYPE error code, represented as 222 in decimal and 0xDE in hexadecimal, indicates that a file type being saved or retrieved has been blocked. This error is typically encountered during operations involving files or directories.

Error Details

This error suggests that the system has detected an attempt to access or modify a file with a type that is not allowed by the current security policies or configuration settings. The specific file type may be restricted due to various reasons, such as antivirus software, group policy settings, or application-specific restrictions.

Usage Context

The ERROR_BAD_FILE_TYPE error can occur in several scenarios:

  • When attempting to save a file with an unsupported extension.
  • During the retrieval of a file that has been blocked by security policies.
  • In situations where the system enforces strict file type validation, such as when dealing with sensitive or critical files.

Developer Interpretation

Developers should interpret this error code as an indication that the operation was blocked due to the file type being considered invalid or inappropriate. This can be useful for debugging and ensuring compliance with security policies. Developers may need to adjust their application logic to handle such cases gracefully, possibly by prompting users to change the file type or providing alternative actions.

Related Errors

  • ERROR_ACCESS_DENIED (5) - May occur if the operation is blocked due to insufficient permissions rather than a specific file type restriction.
  • ERROR_PATH_NOT_FOUND (3) - If the file path itself is invalid, leading to an attempt at an unsupported file type.
  • ERROR_INVALID_PARAMETER (87) - If there are issues with parameters passed during the operation that could lead to this error.

FAQ

Q: What does ERROR_BAD_FILE_TYPE mean?

A: It indicates that a file type being saved or retrieved has been blocked by security policies or configuration settings.

Q: How can I resolve this issue?

A: Review your application's logic and ensure it adheres to the allowed file types. Check for any security policies or restrictions in place and adjust accordingly.

Summary

The ERROR_BAD_FILE_TYPE error code is a specific indication that a file type being accessed has been blocked by system policies. Developers should handle this error by validating file types and ensuring compliance with security settings to avoid such issues.