Windows – Why isn’t it possible to name a folder “._.” in Windows 7

windowswindows 7

I just noticed that it is not possible to name a folder ._. – it gets named ._ instead. Sometimes, it disappears just after naming it but reappears after refreshing the view. Windows seems to have a problem with dots at the end of a filename – why is this?

Best Answer

Windows normally requires files to have either no extension or an extension that is at least one character long; it's not cool with zero-length extensions, i.e. file names that end with .. Folders can have extensions too, therefore, Windows doesn't let their names end with a .. Source, from the article that DavidPostill linked:

Use a period to separate the base file name from the extension in the name of a directory or file.

(Emphasis mine.) If you try to end a file or directory named with a period, Windows just assumes you wanted no extension and so removes it, even if you create it with md in a command prompt.

Danger zone! If you direly want a folder name to end with ., you'll need to use the magic raw name override sequence of \\?\. In a command prompt, md \\?\C:\path\to\container\._. will indeed create a folder named ._., but lots of programs will have problems with it, even Explorer:

._. problems

Such a directory can only be removed with rd followed by its \\?\ name or renamed with its short (8.3, dir /x) name.