I just encountered a really weird bug on Windows 8.1.
I can't seem to be able to create a folder named Aux
or starting by Aux.
.
I tried on every disk, but I get the following message every time: Le nom du périphérique spécifié n'est pas valide
(The name of the specified device is invalid
).
Why is that? Is there a specific/valid reason? Is it specific to my computer?
I discovered this because I programatically created a folder named Aux
and I can't delete it anymore. I guess I have to run a script or program to get rid of it. (As it usually happens with such scenario on Windows)
aux
, prn
, and con
(among some others) are reserved for legacy reasons. prn
refers to the printer, for instance, and con
refers to the standard keyboard (console). It's a remnant of MS-DOS retained for compatibility reasons, I'd guess.
You can still see con
in use at a command prompt: type copy con test.txt
in a folder where you have write access, type some text, and hit F6 to commit to disk, and then type test.txt
to display what you typed on the screen.
There's a bunch of information in Naming Files, Paths and Namespaces (Windows) - for the parts that are relevant to your question, see the section with the bullet points, specifically this item:
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, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended. For more information, see Namespaces.
来源:https://stackoverflow.com/questions/36225708/cannot-create-a-directory-named-aux-or-starting-by-aux-on-windows-8-1