Limit Windows Shell Extension to Folder / Drive
I am working on a shell extension that is supposed to display the extended properties of files (mostly .jpg) stored on a virtual disk (think of it like an external hard disk).
Is it possible to register a shell extension so that it only loads for files of a specific folder / drive (in my case external hard drive) and leaves the jpg processing in a different folder for the default windows shell extension
Hello,
Sebastian
a source to share
This article lists the ways to register a shell extension: http://msdn.microsoft.com/en-us/library/cc144096(VS.85).aspx .
You should be able to create a system folder on your external hard drive that contains a desktop.ini file that points to the extension.
Alternatively, inside the extension itself, you can check for the path and not execute additional logic if it is not in the location you specified.
a source to share
As far as I understood registering a shell extension in the registry, there is no such thing as "restrict it to a specific folder". Your extension must be globally registered and implemented in such a way that it does not display additional context menu items if this is not appropriate.
In the registry, shell extensions are tied to file types in the CLASSES_ROOT key. The whole process is for the file system. Thus, the file type resolution is the best you can get. Looking at this, everything else (such as the path / drive / disk type for a given file) is too volatile to make the basic registration on it sane.
a source to share