Add a Windows Shell context menu entry for a specific extension (not file type)

后端 未结 1 1962
[愿得一人]
[愿得一人] 2020-12-14 12:48

To add a Windows shell context menu, let\'s say for .txt files - if the .txt extension in HKEY_CLASSES_ROOT (or in HKEY

相关标签:
1条回答
  • 2020-12-14 13:17

    Here you go:

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\*\shell\your custom app]
    @="Open with your custom app"
    "icon"="C:\\Windows\\notepad.exe,0"
    "AppliesTo"=".nfo"
    
    [HKEY_CLASSES_ROOT\*\shell\your custom app\command]
    @="C:\\Windows\\notepad.exe \"%1\""
    

    The line "AppliesTo"=".nfo" does the trick.

    Works perfectly on Windows 10.

    It works per file extension, regardless if there is an application associated with that extension or not. Doing this way it less invasive and leaves a very small footprint in the registry.

    Compare to Add menu item to windows context menu only for specific filetype


    Edit:

    If you want to apply that command to more than one extension use:

    "AppliesTo"="System.FileName:\"*.nfo\" OR System.FileName:\"*.log\""
    

    Credit: https://superuser.com/questions/183785/windows-7-context-menu-for-folders-if-folder-contains-certain-filetypes

    0 讨论(0)
提交回复
热议问题