F4 button opens file in notepad with generic icon.

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

TheOwner
Junior Member
Junior Member
Posts: 14
Joined: 2022-08-01, 00:23 UTC

F4 button opens file in notepad with generic icon.

Post by *TheOwner »

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
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: F4 button opens file in notepad with generic icon.

Post by *white »

On my Windows 11 pc, when notepad.exe is executed, this file is executed:

Code: Select all

C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2305.18.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe
When notepad is opened, check the Windows Task Manager, Details tab, and enable the column Command Line to see which file is actually opened.
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *hi5 »

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)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *ghisler(Author) »

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
TheOwner
Junior Member
Junior Member
Posts: 14
Joined: 2022-08-01, 00:23 UTC

Re: F4 button opens file in notepad with generic icon.

Post by *TheOwner »

Thanks for answer. So both notepads are identical in terms of funkcionality, just one of them has no icon?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *ghisler(Author) »

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
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *petermad »

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.
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.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *ghisler(Author) »

2petermad
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
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: F4 button opens file in notepad with generic icon.

Post by *Dalai »

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).
Some time ago I made the exact same discovery with some Windows executable file, probably taskmgr.exe.
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.
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.

Windows is getting worse with every iteration...
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?
The file icon shown in TC's panel. Not sure if that's also used in Windows 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
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *ghisler(Author) »

The file icon shown in TC's panel.
You mean the icon for .txt files? That comes from file associations, not from the editor configured for F4.
Or the icon of the exe file itself?
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *petermad »

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?
Everywhere - see:
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.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: F4 button opens file in notepad with generic icon.

Post by *Dalai »

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
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *petermad »

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.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *ghisler(Author) »

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
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: F4 button opens file in notepad with generic icon.

Post by *petermad »

I don't think that there is anything I can do about it
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.

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.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply