Windows Notepad Icons Become White Blank Looking Document Page

Windows Notepad Icons Become
White Blank Looking Document Page

https://jawchemist.blogspot.com/
JAWChemist@gmail.com                                                                                       01/13/2021
Disclaimer                                                                                                      Ver. 20210113-01

INTRODUCTION

A text file saved on Windows 10 Desktop had the Notepad icon Figure 1. The icon changed around 01/10/21 but still opened in Notepad. The new icon looked like a blank white document with a dog-eared top right corner Figure 2. Although it looked blank, it actually had gray bars that represented lines of text.


 Figure 1 Notepad Icon                                        Figure 2 New Icon


PROBLEM

The symptoms were that all the .txt and .log files or shortcuts used to open them in file explorer or on the desktop no longer showed the Notepad icon. The problem was how to associate text files with the Notepad icon.

SOLUTION

The registry entry HKEY_CLASSES_ROOT\txtfile\DefaultIcon was edited with regedit and the value changed from %SystemRoot%\system32\imageres.dll,-102 to %SystemRoot%\system32\notepad.exe,- 2. After rebooting the computer, the .txt file extension showed the Notepad icon.

RESULTS

After editing the registry key, files with the .log, .txt and .scp file extension showed the Notepad icon.

DISCUSSION

General Comments

A search for the issue and solution found several things to try and are commented on below. Some involved editing the registry.

Information on the “Site” https://www.winhelponline.com/blog/change-default-icon-file-type-windows/  was used to resolve the problem. All the keys on the site were present and had values in the registry so they did not have to be created. Some of the registry entries were different from those referenced on the web site. 

Resolution

The “Site” suggested checking the registry entry HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice to find the identifiers for the .txt extension. On the “Site”, the ProgId content was “txtfile”. In the registry on the computer, the ProgId content is “textfile”. The difference in the spelling of the ProgId contents between the “Site” and the registry entry on the computer was not noticed until this paper was being written.

The web page command assoc | findstr /i "txtfile" was run in a cmd window. As in the web page, it showed 4 files associated with “txtfile”: .log, .scp, .txt and .wtx.

It then instructed you to go to the HKEY_CLASSES_ROOT\txtfile\DefaultIcon entry. The entry was %SystemRoot%\system32\imageres.dll,-102 instead of c:windows\system32\shell32.dll, 216 as shown on the website. It is believed that previously one could check the properties of a file and see the icons in a file like C:\Windows\System32 \moricons.dll. Now checking icons seems to be only an option for folders. NirSoft IconExtract was used to look at icon 102 in imageres.dll. It was the Figure 2 icon. The lines in the icon did not show up due to the screen brightness, contrast and color setting so it appeared like a blank white dog-eared document page. Any files found (no .wtx files were found) on the computer that had extensions listed by the assoc command also had the new icon. IconExtract was used to check Notepad.exe for icons and it only had one labeled with (2). The entry was changed to %SystemRoot%\system32\notepad.exe,-2 and after rebooting the Notepad Figure 1 icon had replaced the Figure 2 icon. All the icon for files listed by assoc for “txtfile” had also changed to the Notepad icon.

Finding Files with Extensions

The not found.wtx extension is a “plain text files associated by default to Microsoft Windows 7”. These are generally Windows developers’ reference details for their applications. Lookeen Free was used to find the file extensions in data folders but it is not used to index system files. Windows search was used to find extensions in system files. Windows search did not find the .wtx. Lookeen Free does seem to have an issue with the site certificate for the free (not 14 day trial) and can be tagged as not secure. It is also seems to be about 5 years old

Details Involving Icons

It is not known and was not investigated why some references to icons use just the number and others have a “-“ in front of it but it does not seem to matter. Icon 216 in shell32.dll as listed on the website did not exist when viewed with IconExtract. Windows 8 does have a 216 (Figure 3) icon but it is not the Notepad icon.

 

Figure 2 Shell32.dll Icon 216 Windows 8


Post Resolution Findings

The associate command ran with “textfile” as shown in the registry had no associated file extensions. Attempting to edit the registry ProgID from “textfile” to “txtfile” gave the message.

 

Figure 4 Editing a Registry Entry


This indicates that the permissions for the editing the entry required changing to allow for editing. This can be accessed by right clicking UserChoice, Permissions… . It was edited to “txtfile”. No immediate changes were noted but at least some registry changes are loaded at startup and require a reboot to become effective.

 The registry entry for HKEY_CLASSES_ROOT\textfile\DefaultIcon changed to c:\windows\system32\notepad.exe after being manually set to %SystemRoot%\system32\notepad.exe,-2. When reset back to %SystemRoot%\system32\notepad.exe, -2, a system reboot did not change the entry. It is not known when, how or by what the manual entry was changed.

Other Things Tried (in order tried)

1.     Associating the value in HKEY_CLASSES_ROOT\txtfile\DefaultIcon to Word and back to Notepad with reboot did not correct the issue.

2.     Associating default files by type (.txt) and rebooting did not correct the issue. This was done in Windows 10 Settings, Apps, Default Apps, Choose default apps by file type, .txt. This procedure makes icons change immediate without reboot.

3.     Deleting the IconCache.db in "%UserProfile%\Local Settings\Application Data and rebooting did not correct the issue. There are other places where the file IconCache.db is reported to exist (%LOCALAPPDATA%\IconCache.db, %LOCALAPPDATA%\Microsoft\Windows\Explorer\*.db see https://www.tenforums.com/general-support/147973-white-icons-desktop.html) and suggested they be deleted. This was not done.

4.     Modifying the value of the string value of MaxCachedIcons to 2048 in the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer and rebooting did not correct the issue.

5.     Running DISM /Online /Cleanup-Image /RestoreHealth and SFC /Scannow showed no issues and rebooting did not correct the issue.

6.     Changing the entry in HKEY_CLASSES_ROOT\txtfile\DefaultIcon\ from %SystemRoot%\system32\Notepad.exe, -2 to %SystemRoot%\system32\imageres.dll,-102 with reboot cause the issue to reappear. Setting it back to Notepad.exe, -2 caused the issue to be corrected.

7.     Using Windows Default files by type

a.      Associating Default files by type (.txt) in Window’s setting to Word and rebooting reverted to New Icon for .txt files on desktop and in file explorer. Log files (.log) still had Notepad icon. Previously .log file on Desktop had the New Icon. Re-associated .txt file extension to Notepad. Text (.txt) files and .log files immediately showed the Notepad icon.

b.     Associating the .log files to Word immediately showed the Word icon and associating it back to Notepad immediately showed the Notepad icon.

c.      Associating Default files by type (.txt) to Word shows the New Icon but the registry entry HKEY_CLASSES_ROOT\txtfile\DefaultIcon\(Default) still showed Notepad.exe, -2

d.     Changing the .txt association to WordPad does not change to its icon or the registry entry.

e.      The extension .bat shows no associated file type and has no alternate apps to choose. A .bat file on the desktop has the Figure 4 double gear icon.

Figure 5 .Bat file icon

Conclusion

The txtfile icon value in Windows 8 in HKEY_CLASSES_ROOT\txtfile\DefaultIcon from c:windows\system32\shell32.dll, 216 does not exist in the Windows 10 shell32.dll version. Its replacement value was %SystemRoot%\system32\imageres.dll, -102. Although it is a perfectly good icon to use for text and log files, screen settings can make it look like a blank white dog-eared document page. Changing the entry to use %SystemRoot%\system32\notepad.exe -2 seemed to correct the icon issue. However, in a later examination of the registry, the value changed to c:\windows\system32\notepad.exe. 

The use of Windows settings to associate default files appear immediately and do not seem coordinated with the registry entries even after a reboot.

The believed incorrect value entry “textfile” instead of “txtfile” was in the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice. Changing the entry to either “textfile” or “txtfile had no obvious effect.

As always, when something is changed and a customer’s expectations are not met, they can become concerned if there is a deeper issue because of the change as well as frustration having to learn to associate (pun intended) a new image with a familiar task.


No comments:

Post a Comment

Post Labels

Search This Blog