Then I find these: https://fossbytes.com/windows-reserved-folder-con-create/ and jeeswg at https://www.autohotkey.com/boards/viewtopic.php?t=26486
It seems any potential filename that starts with "con." will get a result. I suspect that more of the filenames mentioned in the first link will give false positives (not tested). Furthermore, the documentation for FileExist says:It's like renaming a folder to Con, ordinarily it can't be done, but I believe there is a way to force it.
But even when you do a FileGetAttrib you get "A" for "ARCHIVE", same result as FileExist. And Archive bit is normal for a file. It's not, say, "S" for "SYSTEM". So that's not a real workaround. In fact, I'm thinking that:Since FilePattern may contain wildcards, FileExist may be unsuitable for validating a file path which is to be used with another function or program. For example, FileExist("*.txt") may return attributes even though "*.txt" is not a valid filename. In such cases, FileGetAttrib is preferred.
a) FileExist("C:\con.") should always give an empty string (or something other than "A", but I'm thinking empty, or at least FileGetAttrib should get an empty string like "*.txt" does) unless there is a "real" file, such as something visible called "con." in "C:"
b) likewise, FileExist("c:\con.txt") should only give a string when there is a "real" file, such a text file you created called "con.txt" in "C:"
Thus, this might be a bug. However, I may be wrong. Regardless, if it isn't a bug, this behavior should be mentioned in the documentation.