Search code examples
c#windows-shell

Change display information (like name) of files from a shell extension for explorer.exe


I'm currently working with a Chinese SMB server, on which almost all the company files are stored. As the structure doesn't change, I'd like to be able to put a "label" on files, based on a rules (something that allow me to handle generated files, which includes dates for example). I need only support for win7 and above, and I'd like my informations to be read from a text file rather than relying on some metadata or client's data.

So I thought of writting a shell extension to do the work. My problem is, that by looking at the documentation, I didn't find something that allow me to change the name. The best solution I've found so far is to go with the infotip handler, but I wondering if anyone has a better way to do this.

In short, it needs:

1) To be compatible with win7 (and above),

2) To be visible at first sight

3) To use a readonly fs


Solution

  • After extensive research, I've found that the best way to do it is to write a Shell Namespace extension.

    I'll be able to provide a virtual directory representing my server's structure, and translate the names the way I want.

    This seems a little overkill though, but there's no other way to change the informations displayed as the display name is managed by an IShellFolder which provides it to an IShellView

    One excellent source of informations I've found about it, and the most up to date so far, is an article on Michael Edenfiled's blog