File association problem with .reg and .bat files


  1. Posts : 3
    Windows 10
       #1

    File association problem with .reg and .bat files


    Asus laptop with WINDOWS 10

    When double clicking a .reg file the default action is merge by running the regedit.exe. On the right-click content menu I have Merge (in bold), edit and print, select edit opens the notepad for editing. In order to prevent from merging the .reg file by accidental double clicking, i prefer edit be the default action of double clicking. I went to setting to change the file association from reg editor (the default) to notepad. Then i can't merge the .reg file any more. On the right-click content menu i get open(in bold), edit and print, Notepad opens when i select open, edit or double click. I remember that i can do this by tweaking the registry entery in WinXP but now i forgot how.

    I also want to change the associated default app for .bat from run (by cmd.exe) to edit (by notepad) due to the same reason but can't find a way.

    Will you please help, thank you very much!

    Happy 2016 to all, regards.


    SLo
      My Computer


  2. Posts : 68,893
    64-bit Windows 11 Pro for Workstations
       #2

    Hello SLo, and welcome to Ten Forums. :)

    You might see if the "Open with Notepad" context menu added by the tutorial below may work for you for this.

    Open with Notepad - Add or Remove from Context Menu of Files - Windows 7 Help Forums
      My Computers


  3. Posts : 3
    Windows 10
    Thread Starter
       #3

    Brink said:
    Hello SLo, and welcome to Ten Forums. :)

    You might see if the "Open with Notepad" context menu added by the tutorial below may work for you for this.

    Open with Notepad - Add or Remove from Context Menu of Files - Windows 7 Help Forums

    Thank you for your reply, but the "Add open with Notepad to content menu" method dose not help.
    I may not make myself clear. Please refer to the attached sreenshotFile association problem with .reg and .bat files-screenshot-3-.png
    "open with notepad" is already here. At the top i have an option "edit" it also opens the notepad for reg entry editing. It is fine. What i want is a way to change the default double click action from "opening the regedit.exe for merging the new entry" to "opening the notepad for editing",and keep the right click content menu unchange.

    SLo
      My Computer


  4. Posts : 68,893
    64-bit Windows 11 Pro for Workstations
       #4

    I'm not sure you can change the default double click (open) action without changing the default program to be "Notepad", but this would also effect "Merge" by changing "Merge" to "Open".
      My Computers


  5. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #5

    It's not unsafe to have Merge as the default since you have to then click Yes on the next "are you sure" window which gives you a chance to cancel the action.

    File association problem with .reg and .bat files-areyousure.jpg
      My Computers


  6. Posts : 989
    Microsoft Windows 10 Home
       #6

    I made the same mistake a while back. Open With is a piss-poor implementation in my opinion --- the old file type dialog that let you associate any verb with any command was much better.

    Anyway, to restore the default before your accidental association, you need to delete the UserChoice subkey
    under (check both locations but don't worry if not found)

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.reg

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Roaming\OpenWith\FileExts\.reg

    That should return you to the default of Merge as the default verb.

    Then, to make Edit the default while retaining Merge as a right-click option, go to:

    HKEY_CLASSES_ROOT\regfile\shell

    Double-click (Default) in the right-hand pane & type "edit" (without quotes).

    Keith
      My Computer


  7. Posts : 3
    Windows 10
    Thread Starter
       #7

    KeithM said:
    I made the same mistake a while back. Open With is a piss-poor implementation in my opinion --- the old file type dialog that let you associate any verb with any command was much better.

    Anyway, to restore the default before your accidental association, you need to delete the UserChoice subkey
    under (check both locations but don't worry if not found)

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.reg

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Roaming\OpenWith\FileExts\.reg

    That should return you to the default of Merge as the default verb.

    Then, to make Edit the default while retaining Merge as a right-click option, go to:

    HKEY_CLASSES_ROOT\regfile\shell

    Double-click (Default) in the right-hand pane & type "edit" (without quotes).

    Keith

    Thanks a lot, it works!!
      My Computer


  8. Posts : 989
    Microsoft Windows 10 Home
       #8

    You're welcome. Glad it's sorted.

    And thanks for letting me know. That was a lot of typing/cutting/pasting for someone who's legally blind!

    It's the positive feedback that makes it worth the effort.

    Keith
      My Computer


  9. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #9

    Thanks for the great info Keith. You can bet I saved it for future use.
      My Computers


 

  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 16:37.
Find Us




Windows 10 Forums