What is the extension of a folder in Windows?

There is no defined extension to a directory in Windows; rather, the type ("file" versus "directory") is kept in the master file table.

You should be able to see all files' extensions by just deselecting the "Hide extensions of known file types" in the folder options settings, or you can type command dir from the command line to see the files with extensions and you would see that the folder names do not have any extra extensions.


As others have said, Windows doesn't use filename extensions to identify folders. Folders, also called directories, are actually files but they have a FileAttribute value that identifies them as folders rather than regular files.

At a command prompt, you can type:

c:\temp> dir /a:d

which means, list all the files with the directory attribute, i.e., list of the folders in the current folder (c:\temp). Type dir /? for other options.

In Windows Explorer (for Windows Vista and Windows 7) you can specify a search filter of kind:folder to find the subfolders of the selected location.

There are other FileAttribute values, too; Archive, Compressed, Encrypted are some of the more common ones. You can use scripting and programming languages to examine these attributes. Here's a post on the Scripting Guys blog about using PowerShell to work with file attributes.

FWIW, although you can name a directory something like test.png, I think that's likely to create confusion. Windows won't care, but users might.


Folders are a different type object. They don't have to have a extension to identify them as folders.

The name can consist of any valid characters and that includes ".", so you can call a folder:

test.txt
test.png
etc.


Note that the correct answers here notwithstanding, windows does in fact attempt to classify a folder by its contents and change the presentation based upon the classification.

This classification is called a Folder Type and windows has what is typically called Automatic Folder Type Discovery.

Unfortunately, sometimes merely dropping an mp3 file into a folder changes it's template to "music" even though the other 100 files are txt docs etc.: I don't need to rate my README.TXT as 5 stars with a run length of UNDEFINED.

Altering the behavior requires editing the registry, as far as a I know.