@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