F4 button opens file in notepad with generic icon.
Moderators: Hacker, petermad, Stefan2, white
F4 button opens file in notepad with generic icon.
Hi,
if I press F4 on any file, it opens notepad with generic icon. "C:\Windows\notepad.exe"
I think it should open notepad located in "C:\Windows\System32\notepad.exe"
In Windows 10 22H2 there are two notepads one with and one without icon. I think F4 should lead to system32 notepad version, becuase this notepad is opened when i launch it from Windows Start menu.
TC 10.52 64bit
Windows 10 22H2 64bit
if I press F4 on any file, it opens notepad with generic icon. "C:\Windows\notepad.exe"
I think it should open notepad located in "C:\Windows\System32\notepad.exe"
In Windows 10 22H2 there are two notepads one with and one without icon. I think F4 should lead to system32 notepad version, becuase this notepad is opened when i launch it from Windows Start menu.
TC 10.52 64bit
Windows 10 22H2 64bit
Re: F4 button opens file in notepad with generic icon.
On my Windows 11 pc, when notepad.exe is executed, this file is executed:
When notepad is opened, check the Windows Task Manager, Details tab, and enable the column Command Line to see which file is actually opened.
Code: Select all
C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2305.18.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe
Re: F4 button opens file in notepad with generic icon.
I'm guessing it simply uses the "edit" verb not explicitly calling notepad.exe so you can probably edit the registry, OR simply define the full path to the desired notepad you want to use. Although I can't really imagine people not changing the editor setting to anything else as notepad is so very limited.
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: F4 button opens file in notepad with generic icon.
When you only set notepad.exe as editor without path, then TC first tries to use notepad.exe from the Windows directory, and if that doesn't exist, the one from the system32 directory. You can specify yourself which editor you want to use in Configuration - Options - Edit/View. I prefer the one in the Windows directory because some editors replace it to be called instead of the original notepad.exe.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: F4 button opens file in notepad with generic icon.
Thanks for answer. So both notepads are identical in terms of funkcionality, just one of them has no icon?
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: F4 button opens file in notepad with generic icon.
On my PCs, one with Windows 10 22H2 and one with Windows 11 22H2, both notepad.exe have the exact same content (Files - Compare by Content) and both show up with an icon.
Where do you see a generic icon? Just in the Windows taskbar? Then your Windows icon cache got damaged.
You can save the following code to a batch file, e.g. fixicons.bat, and then run it to recreate the icon cache:
taskkill /f /im explorer.exe
CD /d %userprofile%\AppData\Local
mkdir Backup
Attrib -h IconCache.db
Copy /Y IconCache.db %userprofile%\AppData\Local\Backup
del iconcache.db
start C:\Windows\Explorer.exe
Pause
Where do you see a generic icon? Just in the Windows taskbar? Then your Windows icon cache got damaged.
You can save the following code to a batch file, e.g. fixicons.bat, and then run it to recreate the icon cache:
taskkill /f /im explorer.exe
CD /d %userprofile%\AppData\Local
mkdir Backup
Attrib -h IconCache.db
Copy /Y IconCache.db %userprofile%\AppData\Local\Backup
del iconcache.db
start C:\Windows\Explorer.exe
Pause
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: F4 button opens file in notepad with generic icon.
On my Windows 10 both notepad.exe files (in c:\windows and in c:\windows\system32) also have the same binary content. but still the file in c:\windows\system32 has the light blue notepad icon (and ICLView plugin can show it), and the other one does not.
If I copy c:\windows\system32\notepad.exe to for example c:\test it no longer has that icon.
Also, c:\test\notepad.exe cannot be executed unless I copy c:\windows\notepad.exe.mui to c:\test\da-DK\ (replace da-DK with you locale (en-US, de-DE etc).
I cannot figure out from where c:\windows\system32\notepad.exe get it's icon from, and where the instruction to use that icon is stored.
If I copy c:\windows\system32\notepad.exe to for example c:\test it no longer has that icon.
Also, c:\test\notepad.exe cannot be executed unless I copy c:\windows\notepad.exe.mui to c:\test\da-DK\ (replace da-DK with you locale (en-US, de-DE etc).
I cannot figure out from where c:\windows\system32\notepad.exe get it's icon from, and where the instruction to use that icon is stored.
Last edited by petermad on 2023-07-26, 09:55 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: F4 button opens file in notepad with generic icon.
2petermad
Which icon, the one in the top left corner of the program, or the one in the task bar?
Which icon, the one in the top left corner of the program, or the one in the task bar?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: F4 button opens file in notepad with generic icon.
Some time ago I made the exact same discovery with some Windows executable file, probably taskmgr.exe.petermad wrote: 2023-07-25, 10:10 UTCIf I copy c:\windows\system32\notepad.exe to for example c:\test it no longer has that icon.
Also, c:\test\notepad.exe cannot be executed unless I copy c:\windows\notepad.exe.mui to c:\test\da-DK\ (replace da-DK with you locale (en-US, de-DE etc).
If you happen to find that out, please let me know. Until then I classify this Windows as lying to the user again. Just like Windows lies about its version number to applications which don't have a proper manifest when they call the GetVersionEx() function. Hence I assume that the image functions (LoadIcon or LoadImage) check for hard-coded paths and return some icon despite the file having none embedded.I cannot figure out from wherec:\windows\system32\notepad.exe get it's icon from, and where the instruction to use that icon is stored.
Windows is getting worse with every iteration...
The file icon shown in TC's panel. Not sure if that's also used in Windows Task Bar.ghisler(Author) wrote: 2023-07-25, 10:25 UTCWhich icon, the one in the top left corner of the program, or the one in the task bar?
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: F4 button opens file in notepad with generic icon.
You mean the icon for .txt files? That comes from file associations, not from the editor configured for F4.The file icon shown in TC's panel.
Or the icon of the exe file itself?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: F4 button opens file in notepad with generic icon.
Everywhere - see:ghisler(Author) wrote: 2023-07-25, 10:25 UTC 2petermad
Which icon, the one in the top left corner of the program, or the one in the task bar?
https://tcmd.madsenworld.dk/notepadicons_system32.png
https://tcmd.madsenworld.dk/notepadicons_windows.png
This is for Windows 10
Last edited by petermad on 2023-07-25, 16:12 UTC, edited 2 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: F4 button opens file in notepad with generic icon.
It's about the EXE's icon. Note that the files' icons in the Windows directories themselves, i.e. %SystemRoot% and %SystemRoot%\system32, are (probably) shown properly, but as soon as you copy the file to somewhere else (or create a copy in the same directory with admin rights) the icon will get replaced by the generic executable icon.
And it gets even more complicated with the Notepad app in %ProgramFiles%\WindowsApps that MS introduced - its icon is stored somewhere else entirely.
Regards
Dalai
And it gets even more complicated with the Notepad app in %ProgramFiles%\WindowsApps that MS introduced - its icon is stored somewhere else entirely.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: F4 button opens file in notepad with generic icon.
Actually looking closer:
In https://tcmd.madsenworld.dk/notepadicons_system32.png the icon in the upper left corner of the Notepad window is a little different from the rest.
In https://tcmd.madsenworld.dk/notepadicons_windows.png the icon in the upper left corner of the Notepad window and in the Task window for the Notepad window are a little different from the rest.
Also the icon in TC's file panel for c:\windows\notepad.exe shows differently depending on the setting of "Show default folder/file icons from Explorer" - if enabled TC shows the same icon as in the taskbar for notepad.exe.
In https://tcmd.madsenworld.dk/notepadicons_system32.png the icon in the upper left corner of the Notepad window is a little different from the rest.
In https://tcmd.madsenworld.dk/notepadicons_windows.png the icon in the upper left corner of the Notepad window and in the Task window for the Notepad window are a little different from the rest.
Also the icon in TC's file panel for c:\windows\notepad.exe shows differently depending on the setting of "Show default folder/file icons from Explorer" - if enabled TC shows the same icon as in the taskbar for notepad.exe.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: F4 button opens file in notepad with generic icon.
That must be a bug in Windows 10, it doesn't do that on Windows 11. I don't think that there is anything I can do about it. 

Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: F4 button opens file in notepad with generic icon.
I don't think that it is something that you should even bother do anything about - If the system chooses to not have the icon embedded in the files, and instead picks it from God-knows-where, depending on the location of the file, than that's on Microsoft, not on you.I don't think that there is anything I can do about it
Explorer shows the same different icons in the file list for c:\windows\notepad.exe and c:\windows\system32\notepad.exe as TC does.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar