Location of the "Edit" context menu entry for .reg files


  1. Posts : 57
    Windows 10
       #1

    Location of the "Edit" context menu entry for .reg files


    So when I edit .reg files, I prefer to edit them with VS Code instead of notepad by default. I notice that .reg files have an "edit" context menu entry that appears when you right click on them, but this context menu entry opens up notepad by default. It tried adding the following key:

    Code:
    Windows Registry Editor Version 5.00[HKEY_CURRENT_USER\SOFTWARE\Classes\SystemFileAssociations\.reg\shell\Edit\command]@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
    But this doesn't work like it does for some file extensions (such as .py, for example; this method worked perfectly for .py files) because I'm pretty sure something else in the registry has higher priority than this; the problem is, I don't know what.

    Can somebody please direct me to the registry key that is taking priority over this one for the "Edit" command that appears in the context menus of .reg files? Thanks.
      My Computer


  2. Posts : 14,019
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #2

    Right-clicking a .reg file in File Explorer gives the first 2 items on the context menu of Merge and Edit. Merge is a direct action that requires acceptance and Edit opens Notepad. [Notepad is not a word processor, just a text editor useful for notes, programming and HTML editing, very basic.] Maybe your Default File Associations have been messed with, changed to a different program for a file type?

    This is what a 'normal' .reg file looks like:
    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs]
    @="Install"
    "HasLUAShield"=""

    [HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command]
    @="cmd /k dism /online /add-package /packagepath:"%1""
    Proper coding is important.
      My Computers


  3. Posts : 17,838
    Windows 10
       #3

    JohnTravolski said:
    So when I edit .reg files, I prefer to edit them with VS Code instead of notepad by default. I notice that .reg files have an "edit" context menu entry that appears when you right click on them, but this context menu entry opens up notepad by default. It tried adding the following key:

    Code:
    Windows Registry Editor Version 5.00[HKEY_CURRENT_USER\SOFTWARE\Classes\SystemFileAssociations\.reg\shell\Edit\command]@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
    But this doesn't work like it does for some file extensions (such as .py, for example; this method worked perfectly for .py files) because I'm pretty sure something else in the registry has higher priority than this; the problem is, I don't know what.

    Can somebody please direct me to the registry key that is taking priority over this one for the "Edit" command that appears in the context menus of .reg files? Thanks.
    Did you add any of these options upon installation?

    Location of the "Edit" context menu entry for .reg files-000243.png
      My Computer


  4. Posts : 2,799
    Linux Mint 20.1 Win10Prox64
       #4

    Under this key below, change the value of Default to vscode instead of Notepad.

    HKEY_CLASSES_ROOT\regfile\shell\edit\command
      My Computer


  5. Posts : 3,274
    Win10
       #5

    Also have a look at the instructions shown here:

    Right click on Windows folder and open with Visual Studio Code thisDaveJ
      My Computers


  6. Posts : 2,913
    Windows 10 Pro for the Bro
       #6

    Consider this solution:

    1) Download Context Menu Tuner (from Winaero - Free small and useful software for Windows)
    2) Open the app. On the left side, select: <Add Custom Item...>
    3) Press the Add > > button
    4) Press Add to specific file type
    5) Type reg in that search box, then press the small box to make a check mark, press OK
    6) For Menu Item Title, type something such as: Edit with Visual Studio Code
    7) For Executable File Path, press the Browse... button and go to the Visual Studio Code's program folder and select the executable file (sorry I don't know which file that is, but you can figure it out from there).
    8) Press the Create button
    9) Try it out. If it works, then that's great! (You can go back to this options box and customize the icon and other settings).
      My Computer


  7. Posts : 57
    Windows 10
    Thread Starter
       #7

    topgundcp said:
    Under this key below, change the value of Default to vscode instead of Notepad.

    HKEY_CLASSES_ROOT\regfile\shell\edit\command
    Thanks, that was all I needed.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:32.
Find Us




Windows 10 Forums