The best way to add an entry to the Edit Control Block (ECB) in SharePoint is, to implement a feature, which adds a custom action as described in the SharePoint SDK. So, implementing a feature, to add an entry to each list or library in a web is very simple.

1. Create the feature-file

<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns=""
         Description="Testing the custom action in the ECB">
    <ElementManifest Location="elements.xml"/>

There are no secrets within the feature-file. Its scope is set to "Web", so the feature could be activated in the web-settings.

2. Create the elements-file

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="">
  <CustomAction Id="MyCustomActionId"
                Title="My Custom Action">
    <UrlAction Url="{put your target address in here}"/>

In the elements-file we have the set the location. As RegistrationId we use the System-ContentType "0x". So, we also need to set the RegistrationType to "ContentType". With these settings, the entry is added to the ECB in each list and library of the web.

With the RegistrationId it is possible, to use the entry only with specific lists or content types. Have a look into "…\12\TEMPLATE\FEATURES\ctypes\ctypeswss.xml" for the ID of the buildin content types. As an example, you can set the RegistrationId to the value "0x010102" when the entry should be added for pictures only.