Share via

No error dialog message when creating a file with a character '?' in its name

Anonymous
2025-04-29T10:44:14+00:00

When I create a file with name having a character '?' in the file name. Neither a file is created, nor I see any error message from Windows. But when I do the same with other invalid characters like ':', I see a dialog as below

Windows for home | Windows 11 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Ramesh Srinivasan 81,155 Reputation points Independent Advisor
    2025-04-29T11:29:04+00:00

    Hi Muhammad,

    The reserved characters, "?" and "*", are also wildcards. Hence, you can type the File Open or Save as dialog boxes to list files in a folder via the common dialog. However, you can't save files with such reserved characters in the file name.

    Please see:

    Naming Files, Paths, and Namespaces - Win32 apps | Microsoft Learn:

    https://learn.microsoft.com/en-us/windows/win32...

    Excerpt:

    *******

    Do not use the following reserved names for the name of a file:

    CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, COM¹, COM², COM³, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9, LPT¹, LPT², and LPT³.

    *******

    and

    *******

    The following reserved characters:

    < (less than)

    > (greater than)

    : (colon)

    " (double quote)

    / (forward slash)

    \ (backslash)

    | (vertical bar or pipe)

    ? (question mark)

    * (asterisk)

    *******

    Maybe you're not getting the "file name is not valid" message is because "?" and "*" are wildcards.

    MS-DOS and Windows Wildcard Characters | Microsoft Learn:

    https://learn.microsoft.com/en-us/previous-vers...

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Ramesh 176.2K Reputation points Volunteer Moderator
    2025-04-30T14:08:32+00:00

    Now I understand, thank you for explaining.

    You're welcome, Muhammad.

    Regards,

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2025-04-30T06:56:02+00:00

    Now I understand, thank you for explaining.

    Was this answer helpful?

    0 comments No comments
  3. Ramesh Srinivasan 81,155 Reputation points Independent Advisor
    2025-04-30T06:38:46+00:00

    Hi Muhammad,

    You don’t see the same error for ? and * is because they are wildcards. The other reserved characters I mentioned are not wildcards.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2025-04-30T04:15:05+00:00

    Thank you for replying,

    Yes, I understand.

    let me rephrase my question, why the behavior is not consistent? I see an error dialog when the name has ':' but not in case when there is a character '?'.

    Was this answer helpful?

    0 comments No comments