Windows 10 Reserved file names.

jk8

New Member
Joined
Oct 9, 2018
People at various times run into mysterious problems that have no apparent source but are eventually found out to be caused by the innocent use of a file named "aux.txt" or any one of the other reserved file names. It isn't realistic to expect that all users of such an ubiquitous system as Windows would learn about this technical limitation and remember what the reserved file names are. Is there any reason why the Windows file system does not check for this in order to either forbid these names, or at least issue a warning to the user when their presence is detected? The system knows what names are forbidden, users do not.
 
Windows does generate an error basically that the file/directory name is invalid. These reserved words date back to DOS and still are used with in batch files which is why they haven't been removed.
 
Windows Explorer checks for that, but that's only one particular app which is written to do so, it's not the underlying file system. Others, for example Microsoft Studio Code which happens to be in front of me right now, let me create source files with forbidden names. This program is not explicitly designed to handle the file system and it doesn't know to check for this. We can't expect all application software to do so. But if the name check was in the underlying file system itself instead of a higher layer of one program (maybe more, I don't know) then it would prevent the problem at large. Reality is, files are created, renamed, imported in various ways, and the system accepts them.
 
Tested explorer, cmd and VS code none of them let me create those files. They should all ultimately call into ntdll.dll and then into kernel mode I couldn't tell you where the check is but it's most likely in ntdll.dll or the kernel itself.

Tested from the SYSTEM account as well and still not able to make reserved files.
 
VS Code prevents it for you? For me (version 1.28.0) it lets me name a source file aux.rs, which leads to compilation errors. If I try to name it aux?.rs however an error message is generated:

"The name aux?.rs is not valid as a file or folder name. Please chose a different name."

...and the file is renamed auxÉ.rs instead to avoid the problem. If I try to name it aux.rs then there is no warning and the name is accepted without change. Forbidden file names due to invalid characters are treated different than forbidden file names.
 
Is this the right place to report this glitch, or is there a better way to do so?
 
Looks like it lets you save if there is a unicode character, which even without the aux in the name unlikely would compile.
 
There is no unicode in aux.rs and it lets me save it.

I'll look for some place to report it at Microsoft. Thanks for the input!
 
Yes, it was the result of attempting to rename aux.rs to aux?.rs: the illegal question mark was replaced with a legal unicode character.

I am now trying to reproduce it but without success, the new name with its illegal character is simply rejected and the former name is restored. But I can rename it to other illegal file names such as con.rs, com2.rs and so on.
 
Back
Top Bottom