Welcome to MSDN Blogs Sign in | Join | Help

What is the difference between the Folder and Directory (and other special) progids?

When you're installing your shell extension, you need to know which progid to hang it off of inside HKEY_CLASSES_ROOT. We'll start with the title question and then move on to other predefined (but perhaps not well-known) progids.

  • "Folder" is the progid for any shell folder. It could be a virtual folder (like Control Panel) or a file system folder (like C:\WINDOWS).
  • "Directory" is the progid for file system folders. This is a subset of "Folder".
  • "*" is the progid for all files. Doesn't matter what the extension is.
  • "." (that's a single period) is the progid for files without any extension.
  • "AllFileSystemObjects" is the union of "*" and "Directory". It is the progid for all files and for file system directories.
Published Thursday, August 02, 2007 7:00 AM by oldnewthing
Filed under:

Comments

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 10:46 AM by Tom

Sorry to be lazy and not look this up, but is AllFileSystemObjects really * and Directory and not * and Folder?  It seems odd that it would limit itself to just system folders...

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 10:56 AM by Stupid person

Err, so what is the difference between a folder and a directory?

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 10:57 AM by John

Tom - why would you want something that applies to "all file system objects" to appear on virtual folders like Control Panel?

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 11:03 AM by Bahbar

Stupid person - You want to reread the first bullet. No really.

Here:"Folder" is the progid for any shell folder. It could be a virtual folder (like Control Panel) or a file system folder (like C:\WINDOWS).

Hint, it makes a distinction between 2 things. virtual folders and file system folders. You still do not see the difference ?

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 11:04 AM by Smart person

> Err, so what is the difference between a folder and a directory?

Err, he just explained it.  Here, let me show you a picture:

+-------------------------------+

| - FOLDER -                    |

| Control Panel                 |

| My Computer                   |

| My Network Places             |

| and so forth                  |

|                               |

| +---------------------------+ |

| | - DIRECTORY -             | |

| | C:\Documents and Settings | |

| | C:\Program Files          | |

| | C:\Windows                | |

| | and so forth              | |

| +---------------------------+ |

|                               |

+-------------------------------+

Understand?

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 11:05 AM by Googol

Then, why microsoft make Control Panel looks like a directory?

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 11:13 AM by Anonymous

Googol: Microsoft made the Control Panel look like a directory for the same reason that everything is a file in UNIX;  it allows for uniform access.

I could be wrong, this is a guess on my part, but from the developer's perspective all of our compiled and scripted languages don't have to support a new API, they can use existing, tried and true, file system API's to access the Control Panel, or any other thing that has a directory/file interface.

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 11:30 AM by Mr Cranky

I think this discussion would be clearer if "file system" was hyphenated (i.e. "file-system") as it probably should be when used as an adjectival phrase.  

However, when reading an article about programming, it pays to read closely, Tom & Stupid Person.

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 12:54 PM by Bob

Anonymous: Not so much. Yes, you can do stupid IShellWhateverInterface tricks to access the Control Panel the same way you could C:\WINDOWS\SYSTEM32\SOL.EXE, but none of the "classical" filesystem APIs (fopen, std::ifstream, CreateFile) let you walk into virtual folders like Control Panel and My Computer by default.

Unix does what it does because it makes the APIs identical for the programmer. Windows does what it does because it makes the GUIs identical for the user. There's a difference.

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 1:57 PM by Daniel

Off into grammar nitpick land we go, sorry...

> I think this discussion would be clearer if "file system" was hyphenated (i.e. "file-system") as it probably should be when used as an adjectival phrase.

It shouldn't be hypenated; it's like "red house doors", not "high-flying airplanes."  Yes, it's ambiguous - is the house red or are the doors?  Apparently, the language designers didn't forsee the need for grouping operators. ;)

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 2:00 PM by quartic

Is it correct to say that "folder" is a general term meaning an interface and container for a collection of objects whereas a "directory" is a physical container located on some storage medium? Thus all directories are folders but not all folders are directories. Some folders are interfaces generated in memory.

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 2:14 PM by KenW

Mr Cranky: "However, when reading an article about programming, it pays to read closely, Tom & Stupid Person."

Almost got it. Remove the word "closely" from what you posted, and add a couple of other words, and it's right:

"However, when reading an article about programming, it pays to actually read it, Tom & Stupid Person."

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 2:49 PM by Wolf Logan

quartic -- that's essentially it. Folders belong to the Shell, Directories belong to the File System. The Shell treats Directories as a type of Folder, so you could say that Directories are Folders, but not all Folders are Directories.

In Vista things get a little more complicated, with virtualisation adding Virtual Directories to the mix, but that's not what Mr. Chen's talking about here.

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 4:07 PM by Rick C

quartic, regarding "red house doors," of course the language has constructs to remove that particular type of ambiguity, such as "doors on the red house" or "red doors on the house." :)

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 6:48 PM by Tom

@Mr Cranky

For some reason my brain skipped over the first parenthetical, and when I read "file system" instead of "filesystem" or "file-system" the illusion was complete.  Thank you for your civility in response.

# re: What is the difference between the Folder and Directory (and other special) progids?

Thursday, August 02, 2007 6:57 PM by Merus

Aah, I was wondering why my little right-click item (internal only, thank god) was turning up on system folders. Thank'ee, Raymond.

# Interesting Finds: August 3, 2007

Friday, August 03, 2007 11:03 AM by Jason Haley

# re: What is the difference between the Folder and Directory (and other special) progids?

Friday, August 03, 2007 1:01 PM by JamesNT

Since Mr. Chen actually went through the trouble to make a post about this, I am left with one inevitable conclusion:

I can't believe he actually had to explain this.  And I'm being very serious.  I consider this one of the first things anyone making a shell extension must learn.

JamesNT

# re: What is the difference between the Folder and Directory (and other special) progids?

Friday, August 03, 2007 2:25 PM by Pavel Lebedinsky

This information can be useful for normal users as well, not just shell extension writers. For example, here's how you can make files without extension to open in notepad when double-clicked:

[HKEY_CLASSES_ROOT\.\shell\open\command]

@="notepad %L"

# re: What is the difference between the Folder and Directory (and other special) progids?

Sunday, August 05, 2007 10:44 AM by Stephen Jones

file-system directories is the punctuation that Bill Walsh, head copy editor at the Washington Post would insist on.

I would suggest there is not enough ambiguity to make it necessary; after all what on earth would a file system-directory (which is the only other alternative meaning) be.

# re: What is the difference between the Folder and Directory (and other special) progids?

Tuesday, August 07, 2007 10:09 AM by umeca74

haven't we forgotten HKEY_CLASSES_ROOT\Drive?

[I have yet to encounter anybody who was confused by that one. This is not "A complete list of all progids" just a selection of ones that are not well known/easily confused. -Raymond]

# re: What is the difference between the Folder and Directory (and other special) progids?

Wednesday, August 08, 2007 7:37 AM by Brandon Paddock

Quartic - "Folder" is the word a Shell developer uses when they mean "An implementation of IShellFolder."

# Why should there be a difference between folders and directories?!

Wednesday, August 08, 2007 11:08 AM by Mark H-A

As a Mac and Windows user, I spent the last decade believing that "folder" and "directory" meant the same thing.

Now I've read that not only is one a subset of the other, but that which way round they go depends on the platform!

Mac: directory > folder

Windows: folder > directory

Why have we redefined these old terms to mean different things?

New Comments to this post are disabled
 
Page view tracker