Why can we not use any special characters (?, <..) in a Windows filename?
Asked
Active
Viewed 6,009 times
2
-
http://en.wikipedia.org/wiki/Filename – zengr Oct 28 '10 at 05:35
-
Because they have special meanings like input/output redirection, drive letter delimiter, 32k Unicode name support etc – Remus Rusanu Oct 28 '10 at 05:36
-
similar [What characters are forbidden in Windows and Linux directory names?](https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names) – milahu Jan 03 '22 at 20:11
-
More specifically, *"[Reserved characters and words, In Windows](https://en.wikipedia.org/wiki/Filename#In_Windows)"* – Peter Mortensen May 05 '23 at 21:40
3 Answers
5
Fundamental rules for Universal Naming Convention (UNC), which enable applications to create and process valid names for files and directories, regardless of the file system:
The following reserved characters:
- < (less than)
- > (greater than)
- : (colon)
- " (double quote)
- / (forward slash)
- \ (backslash)
- | (vertical bar or pipe)
- ? (question mark)
- * (asterisk)
Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255).

Peter Mortensen
- 30,738
- 21
- 105
- 131

Sudantha
- 15,684
- 43
- 105
- 161
-
This lists the characters (which is useful), but it doesn't answer the question (*** *** *** ***why*** *** *** ***). Whether that is a useful question is another matter. – Peter Mortensen May 05 '23 at 21:54
3
Because they have special meanings in the filesystem:
C:*.? - get all files with single letter extensions from the C drive
: \ * ? - all have special meanings

Peter Mortensen
- 30,738
- 21
- 105
- 131

Riho
- 4,523
- 3
- 33
- 48
0
Since some characters are reserved characters in some operating systems, say ?
is used as a wildcard, and /
as a path name component separator.

Peter Mortensen
- 30,738
- 21
- 105
- 131

Ads
- 6,681
- 12
- 47
- 72
-
-
-
That they are reserved characters doesn't answer the question (*** *** *** ***why*** *** *** ***). Whether that is a useful question is another matter. – Peter Mortensen May 05 '23 at 21:56