ERROR_INVALID_NAME - 123 (0x7B)

The filename, directory name, or volume label syntax is incorrect.

Updated: Feb 21, 2026

Overview

The ERROR_INVALID_NAME (123, 0x7B) is a generic error code indicating that the filename, directory name, or volume label provided does not conform to valid syntax rules.

Technical Meaning

This error signifies that an operation was attempted with a string that did not meet the required format for filenames, directory names, or volume labels. The exact nature of the invalidity can vary depending on the context in which it is encountered.

Error Details

The ERROR_INVALID_NAME typically arises when:

  • A filename contains characters or sequences that are not allowed by Windows naming conventions.
  • Directory or volume labels do not adhere to the specified format rules.
  • The operation attempted was incompatible with the provided name, such as attempting to create a file in an invalid path.

Usage Context

This error can occur in various scenarios where file system operations are performed. Common contexts include:

  • Creating or renaming files and directories.
  • Mounting volumes or drives.
  • Parsing paths for file I/O operations.

Developer Interpretation

When encountering ERROR_INVALID_NAME, developers should ensure that the names used in their applications comply with Windows naming conventions. This includes checking for disallowed characters, ensuring proper length constraints, and adhering to case sensitivity rules where applicable.

Related Errors

FAQ

Q: What are the common causes of ERROR_INVALID_NAME?

A: Common causes include using disallowed characters in filenames, exceeding maximum length limits, or providing an invalid path.

Q: How can I prevent this error from occurring?

A: Validate all file and directory names against Windows naming conventions before performing operations. Use appropriate validation functions provided by the Windows API to ensure compliance.

Summary

ERROR_INVALID_NAME is a generic error code that indicates an invalid filename, directory name, or volume label was used in a system operation. Developers should pay attention to naming conventions and validate input data to avoid this error.