Search code examples
windowsshellregistry

How i can add a Entry to Shell Menu only on drive C:\?


I need to add a Context Menu Item to Explorer Shell in Windows. This is easy doing by adding some Registgry Entry:

[HKEY_CLASSES_ROOT\Drive\shell\Disk cleanup\command]
@="cleanmgr.exe" 

but i like to add this entry only for drive C:\ or so. How i can do this?

Thanks!


Solution

  • Try this. (Works on Windows 7 here.)

    [HKEY_CLASSES_ROOT\Drive\shell\Disk cleanup\command]
    @="cleanmgr.exe" 
    "AppliesTo"="C:"
    

    See Creating Shortcut Menu Handlers and Advanced Query Syntax for more about the AppliesTo field.

    I don't see the exact usage above listed for drives but it seems to work and mimics other listed usages.