How to change file icon on txt files ?
-
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
-
@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
-
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\.txtorHKCR\txtfileor 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 theHKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\hierarchy, so you would look at the.txtentry there, though I don’t normally see icon’s defined there. The applications defined for a given extension in that section are defined inHKCU\Software\Classes\Applications\: if you aren’t using the internally-generated icon from the exe itself, then the key for a given application (likenotepad++.exe) could have aDefaultIconsub-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).
-
@Terry-R
i tried to explain i like NPP but not the icon for .txt files, your suggestion does not solve that -
@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
-
@NolanNolan said:
but not the icon for .txt files
What icon are you talking about?
Paste a screenshot showing it? -
@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 11in 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:

- Run
regedit.exeand paste in that key nameHKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\into the “address bar” of the regedit window:
- I navigated to the
UserChoicekey to show thatApplications\notepad++.exeis chosen, showing that Notepad++ is my default app for.txtfiles
- I navigated to the
- Go to
HKCU\Software\Classes\Applications\, and you should seenotepad++.exeas one of the keys
- Right Click on
notepad++.exeand choose to create a New > Key calledDefaultIcon(no space) - On the
(Default)in the right panel, insert the path to the ICO file:
- 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.exeas the(Default)value there - or
%SystemRoot%\System32\imageres.dll,-102will use icon #102 fromimageres.dll, which for my version ofimageres.dllis 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,
.txtfiles 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 shellrefreshor otherwise sendSHChangeNotify( 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.
- Some users find that exiting Explorer isn’t sufficient. If that’s true for you, try one or both of
- Right Click on
- Screenshots with it working for various of the above icons:
cpan.ico:
%SystemRoot%\System32\notepad.exe:
%SystemRoot%\System32\imageres.dll,-102:
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
DefaultIconkey, and doing another refresh/logout/reboot - 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: