Community
    • Login

    File Association gave me more than I bargained for

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 3 Posters 476 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Alan KilbornA
      Alan Kilborn
      last edited by

      So in my job there are two new types of text files that I deal with often; with two corresponding extensions.

      I’m not typically one to do this (certainly have NOT done it for .txt files or any other) but I ran Notepad++ in Administrator mode, went to the File Associations area in the Preferences and "customize"d my two extensions so that they appeared in the Registered extensions box.

      I restarted Notepad++ in non-admin mode and went back to look at my registered extensions and I was surprised to see 10 extensions there, of which my 2 were indeed present. But what gives with the extra (and unwanted) 8 ?

      1 Reply Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn
        last edited by

        Well, if I run as Administrator again, go back in and look, only the 2 new extensions that I wanted are listed in “registered extensions”.

        Maybe I have some misunderstanding of this feature, but I thought you had to run in Admin mode to configure this. Perhaps not.

        It still doesn’t seem to explain why, for my non-Admin mode running of Notepad++, that I went from 0 registered extensions, to 10…

        1 Reply Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn
          last edited by Alan Kilborn

          Back in non-Admin mode, I attempted to remove the undesired 8 extensions from the “Registered extensions”. They appeared to be removed just fine but on my next restart of Notepad++ I checked and they were back again.

          So I’m flummoxed as to what to do next.

          AND…I’d really like to know the proper way of doing what I tried and failed to do (simply add two extensions as “registered”).

          1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn
            last edited by

            Of course now I realize (you can tell I don’t do – and don’t want to do – this kind of thing often…) that simply staying “outside” of Notepad++ and doing the following was probably the better idea, answering properly to this after double-clicking a new extension type:

            d28fa1cb-7cc1-46ba-8648-959fc461e7d0-image.png

            But of course now I realize I really don’t want these file associations at all, and I’m wondering the best way to undo the weird changes done to my registry from what I attempted inside of Notepad++.

            1 Reply Last reply Reply Quote 1
            • PeterJonesP
              PeterJones
              last edited by

              @Alan-Kilborn said in File Association gave me more than I bargained for:

              I’m wondering the best way to undo the weird changes done to my registry

              If you had used a registry-watcher utility to see exactly what changes Notepad++ made, it would be easy.

              In the “good old days” of Windows, where they always used HKCR (or, technically, it’s been using that as an alias to the appropriate sections of HKCU\Software\Classes for user-specific associations and HKLM\Software\Classes for system-level associations), I would have just gone through the .ext entries, and looked up their FileType entries, and modified or deleted those shell commands. However, the “always use this app to open” settings in modern Windows will sometimes use different or convoluted registry entries, and I don’t always know where to look for those. That’s why when I am playing with associations, I prefer to just use the registry directly, and avoid both in-app and windows-gui association manipulations. Unfortunately, MS is fighting harder against that, and I’ve started to see sometimes where MS resets the app that gets used, even though my HK**\Software\Classes settings have remained unchanged; I’m still trying to figure out exactly how MS does the modern “default app” settings.

              Or, the TL;DR version: good luck with that. :-)

              1 Reply Last reply Reply Quote 1
              • PeterJonesP
                PeterJones
                last edited by PeterJones

                I had a flash, and found my document where I’ve taken notes on such things. I’ll post the relevant section in case it’s helpful:

                File Associations

                • User: HKCU\Software\Classes

                • System: HKLM\Software\Classes

                • Old Way: HKCR\

                  • I recently learned HKCR had actually been obsoleted a decade ago (I forget if it was Win95 or WinXP)
                    https://social.msdn.microsoft.com/Forums/vstudio/en-US/630ed1d9-73f1-4cc0-bc84-04f29cffc13b/what-registry-keys-are-responsible-for-file-extension-association?forum=netfxbcl
                • File Extension: HKCU\Software\Classes\.ext\

                  • (Default) = NameOfAssociation (ie, PerlScript or txtfile, etc)
                  • PerceivedType = text (or similar)
                  • ShellNew\
                    • see Customized Context Menu (not included)
                • Association: HKCU\Software\Classes\NameOfAssociation

                  • (Default) = Text Version of Name of Association (shown in Explorer)
                  • DefaultIcon\(DEFAULT) = PathToIcon
                  • Shell\
                    • (Default) = nameOfVerb (sets the default verb to run for double-click)
                    • nameOfVerb\
                      • (Default) = Human Readable Verb
                      • command\(Default) = path\to\exe "%1" %*
                        • make it REG_EXPAND_SZ if you want path to include %EnvironmentVariables%
                • RClick > “Open With” > Use as Default end up here: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\

                  • reference: https://stackoverflow.com/a/3924822/5508606
                  • If you want to go back to the system default, delete ...\FileExts\.ext\UserChoice
                EkopalypseE 1 Reply Last reply Reply Quote 1
                • EkopalypseE
                  Ekopalypse @PeterJones
                  last edited by

                  @Alan-Kilborn ,
                  does not help to explain but I am pretty sure I saw once an issue
                  reporting such behavior and as far as I remember it was due to ignoring
                  errors within registry source code but I can’t find it anymore.
                  As far as I remember it had something to do with this method.

                  1 Reply Last reply Reply Quote 2
                  • EkopalypseE
                    Ekopalypse
                    last edited by

                    @Alan-Kilborn
                    found some discussion from the community.
                    I still haven’t found the problem, maybe it was the linked post
                    I mistakenly thought was reported as a problem.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors