Community
    • Login

    How to change file icon on txt files ?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 5 Posters 99 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.
    • N
      NolanNolan
      last edited by

      Hi

      i use NPP version 8.8.7, windows 11

      I would like to change the default icon for .txt files, after installing NPP.

      How to do that ?

      i tried several methods to no help

      thanks

      Nolan

      Terry RT PeterJonesP 2 Replies Last reply Reply Quote 0
      • Terry RT
        Terry R @NolanNolan
        last edited by

        @NolanNolan said in How to change file icon on txt files ?:

        I would like to change the default icon for .txt files, after installing NPP

        AFAIK the “default” application for a file type provides the icon to be shown for that file type. If you don’t like NPP’s icon, make another text editor the “default” application.

        Terry

        N 1 Reply Last reply Reply Quote 1
        • PeterJonesP
          PeterJones @NolanNolan
          last edited by PeterJones

          @NolanNolan ,

          The same way you would change the default iconf for .txt files after installing any other text editor: by accessing the Windows registry, or using a third-party tool that makes such things easier.

          <here’s the search results from one search engine>

          In the old days, it would’ve been in HKCR\.txt or HKCR\txtfile or similar, with a value/data pair that defined the icon. Setting it there may or may not influence Win11 behavior (as there’s a very strange priority list in the OS, and they are trying to push people and apps away from that). The more modern location for definions on filetypes and applications is to have the filetype in the HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ hierarchy, so you would look at the .txt entry there, though I don’t normally see icon’s defined there. The applications defined for a given extension in that section are defined in HKCU\Software\Classes\Applications\: if you aren’t using the internally-generated icon from the exe itself, then the key for a given application (like notepad++.exe) could have a DefaultIcon sub-key, and that would have a (Default) value pointing to the icon file or icon slot in an exe or DLL – but that would change the file icon displayed for all files that use that application by default, so if you have multiple file types all handled by the same application, changing that might not do what you want.

          Caveat: changing the registry can have dire consequences if you mess up; by taking any registry advice here or anywhere else on the internet, you assume all risks and responsibilities for your actions.


          update: this page describes various things, including how to use the NirSoft “FileTypesMan” utility to change the icon for a specific filetype – I believe it uses the legacy access, but that page claims it still works on Win11, so that might be your best bet, assuming you trust their link to NirSoft, and that you trust NirSoft to not be dangerous (I’ve used NirSoft utils for years, so I trust them, but when you’re talking about the registry, my say-so shouldn’t be enough for your confidence).

          N 1 Reply Last reply Reply Quote 1
          • N
            NolanNolan @Terry R
            last edited by

            @Terry-R
            i tried to explain i like NPP but not the icon for .txt files, your suggestion does not solve that

            Alan KilbornA 1 Reply Last reply Reply Quote 0
            • N
              NolanNolan @PeterJones
              last edited by

              @PeterJones
              thanks, i tied several of these suggestions no solution. The search shows more of a speculation than a solution unfortunately.

              Any other suggestions of solutions to this ?

              third party apps like filetypeman from nirsoft, types.exe or default program editor does not work.

              Thanks

              Nolan

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

                @NolanNolan said:

                but not the icon for .txt files

                What icon are you talking about?
                Paste a screenshot showing it?

                1 Reply Last reply Reply Quote 0
                • PeterJonesP
                  PeterJones @NolanNolan
                  last edited by PeterJones

                  @NolanNolan said in How to change file icon on txt files ?:

                  @PeterJones
                  thanks, i tied several of these suggestions no solution. The search shows more of a speculation than a solution unfortunately.

                  From what I could see, all of those should have worked, depending on the era, and what OS the pages were about. (Unfortunately, even with windows 11 in the search term, often results include non-11-specific answers.) But which one is applicable to your situation depends on your situation, which those sites cannot know, so you have to make educated choices as to which are appropriate based on what you know.

                  Any other suggestions of solutions to this ?

                  My suggestion actually works. See description below.

                  third party apps like filetypeman from nirsoft, types.exe or default program editor does not work.

                  I highly doubt you tried all of those, or at least tried them correctly.

                  Earlier, I mentioned HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ . Since my brief description of what was needed was based on my Win11 experiments a year or two ago, and I’m on a fresh computer compared to those, I thought I’d experiment just to make sure, and it does in fact work.

                  Below, when I mention “key”, it will be displayed as a “folder” in the Registry Editor treeview on the left.

                  • After installing Notepad++, and/or using MS Window’s “Open With” dialog to select Notepad++ as the default application for .txt files, my Windows Explorer shows Notepad++'s icon for .txt files:
                    ad1606c6-6b18-4a88-95be-8bcebfef4f27-image.png
                  • Run regedit.exe and paste in that key name HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ into the “address bar” of the regedit window:
                    3fe5e2bd-ec05-4a60-9821-c1f9166e7b47-image.png
                    • I navigated to the UserChoice key to show that Applications\notepad++.exe is chosen, showing that Notepad++ is my default app for .txt files
                  • Go to HKCU\Software\Classes\Applications\ , and you should see notepad++.exe as one of the keys
                    5e48ffff-dd5b-4320-9c38-53b87d8c9d30-image.png
                    • Right Click on notepad++.exe and choose to create a New > Key called DefaultIcon (no space)
                    • On the (Default) in the right panel, insert the path to the ICO file: 809d369f-f720-44df-b44b-d90cdc2dd48e-image.png
                      • This was just an example icon that I knew where it was on my PC.
                      • You could also use something like the MS Windows notepad.exe’s icon, using %SystemRoot%\System32\notepad.exe as the (Default) value there
                      • or %SystemRoot%\System32\imageres.dll,-102 will use icon #102 from imageres.dll, which for my version of imageres.dll is another “text file” icon.
                      • you just need to pick an icon you like, and point the registry entry there
                    • If you close all Windows Explorer windows and re-open, .txt files will probably show up with the new icon.
                      • Some users find that exiting Explorer isn’t sufficient. If that’s true for you, try one or both of
                        • log out and back in
                        • reboot
                      • Advanced users will be able to use nircmd shellrefresh or otherwise send SHChangeNotify( SHCNE_ASSOCCHANGED , SHCNF_IDLIST , NULL , NULL ); , and be able to avoid even closing the Explorer window(s) – but if you don’t understand either of what I said, then this option isn’t meant for you.
                  • Screenshots with it working for various of the above icons:
                    • cpan.ico: f18268c3-8204-495d-add6-07e5cc6001b9-image.png
                    • %SystemRoot%\System32\notepad.exe: 5ab06335-bd2f-4afd-902a-d9fccbf3a062-image.png
                    • %SystemRoot%\System32\imageres.dll,-102: daa0447c-b90f-419b-856f-dc4c19395642-image.png

                  And to confirm which version of windows I am on, I will share excerpts from my Notepad++ ?-menu’s Debug Info:

                  Notepad++ v8.8.8   (64-bit)
                  Build time: Nov 16 2025 - 20:55:01
                  Scintilla/Lexilla included: 5.5.7/5.4.5
                  Boost Regex included: 1_85
                  Path: C:\Program Files\Notepad++\notepad++.exe
                  ...
                  OS Name: Windows 11 Home (64-bit)
                  OS Version: 24H2
                  OS Build: 26100.7171
                  ...
                  

                  So these instructions do work for Windows 11.

                  But this is all generic Windows OS behavior, so your favorite search engine and a little bit of effort on your part should have been able to come up with the same. This advice is completely tangential to Notepad++, and the answer would be the same whether you installed Notepad++ or SublimeText or any other text editor for Windows that tries to ask the OS to set it as the default editor for txt files, and didn’t like its icon.


                  update: and when you try any of those icons, and see how ugly they all are, including the one you chose, you will be able to revert to Notepad++'s awesome textfile icon by deleting that DefaultIcon key, and doing another refresh/logout/reboot

                  1 Reply Last reply Reply Quote 2
                  • NicholasN
                    Nicholas
                    last edited by

                    Create a txt.reg file with the below content and update the icon path and notepad++ path if required. You can change HKEY_CLASSES_ROOT to HKEY_CURRENT_USER\Software\Classes if you just want the icon for your user account.

                    Run the file to add it to your registry.

                    Right click a text file and Open with > Choose another app. Select a different app (like normal notepad) and click the Always button. Repeat this but select Notepad++ this time. The icon should update.

                    You can do this for other file types by changing all .txt to the other extension and updating the file type description (@=“Text File”).

                    If the icon doesn’t change then there is another reg entry taking priority. I’ve had problems with json and config files because of json_auto_file and config_auto_file.

                    txt.reg:

                    Windows Registry Editor Version 5.00
                    
                    [HKEY_CLASSES_ROOT\.txt\OpenWithProgids]
                    "Notepad++.txt"=""
                    
                    [HKEY_CLASSES_ROOT\Notepad++.txt]
                    @="Text File"
                    
                    [HKEY_CLASSES_ROOT\Notepad++.txt\DefaultIcon]
                    @="C:\\Program Files\\Notepad++\\icons\\text.ico"
                    
                    [HKEY_CLASSES_ROOT\Notepad++.txt\shell]
                    
                    [HKEY_CLASSES_ROOT\Notepad++.txt\shell\open]
                    
                    [HKEY_CLASSES_ROOT\Notepad++.txt\shell\open\command]
                    @="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""
                    
                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors