7

The problem is pretty straightforward. When I set an .html file to open with Chrome, the thumbnail icon is broken and doesn't show the Chrome logo.

I already tried deleting the IconCache.db file and then restarting my computer. Sadly, that didn't fix anything.

It works perfectly fine when I set the default program to IE or Firefox. Any idea on how to fix this issue?

enter image description here enter image description here enter image description here

harrymc
  • 455,459
  • 31
  • 526
  • 924
DrZoo
  • 10,469
  • 4
  • 42
  • 60
  • Does this affect both Chrome 32-bit and Chrome 64-bit? (If you haven't tried the other one, but you're using 64-bit Windows, then give it a shot.) How about Chromium/Canary? If you change icon sizes (small icons / large icons), does that have an impact? – TOOGAM Apr 10 '17 at 05:37
  • @TOOGAM the same thing happens on 32-bit and 64-bit. – DrZoo Apr 10 '17 at 15:31
  • Interesting. The dragged shortcut that contains `html://...` is recognized by Windows as Chrome, but not the one that points to a local html file. Check the value of the registry key `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice`, if `Progid` contains `ChromeHTML`. – harrymc Apr 10 '17 at 15:36
  • @harrymc Progid contains `ChromeHTML` at that registry location. – DrZoo Apr 10 '17 at 15:40
  • I think that the problem is that the file is stored on the desktop itself. Try to put it in some folder, say`C:\Temp`, and to create a shortcut to it. – harrymc Apr 10 '17 at 15:50
  • @harrymc the shortcut method also has a broken thumbnail. In fact, the thumbnail icon is broken all over the place :( It doesn't even show up right in Windows Explorer. – DrZoo Apr 10 '17 at 15:59
  • If you are on Windows 10, rebuilding the icon cache is described in [this link](https://www.howtogeek.com/232779/how-to-rebuild-a-broken-icon-cache-in-windows-10/). – harrymc Apr 10 '17 at 16:09
  • @harrymc I'm on Windows 7, but I tried that same method. The only difference was the file names. I'm about to say screw it :) – DrZoo Apr 10 '17 at 16:16
  • I sort of agree : The problem is trivial and more manipulation may cause more serious problems than the one you have. – harrymc Apr 10 '17 at 16:41

4 Answers4

3

File types and assocations are stored in the Registry, under HKEY_CLASSES_ROOT. Interestingly, that branch isn't actually a hive of its own; it's put together on the fly by combining the \SOFTWARE\Classes data from HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE. HKCU takes precedence, but the assoc and ftype utilities look at HKLM.

The Chrome HTML file type is usually found at HKEY_CLASSES_ROOT\ChromeHTML. If yours is missing or doesn't specify an icon, save this as a .reg and run it:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ChromeHTML]
@="Chrome HTML Document"
"AppUserModelId"="Chrome"

[HKEY_CLASSES_ROOT\ChromeHTML\Application]
"AppUserModelId"="Chrome"
"ApplicationIcon"="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe,0"
"ApplicationName"="Google Chrome"
"ApplicationDescription"="Access the Internet"
"ApplicationCompany"="Google Inc."

[HKEY_CLASSES_ROOT\ChromeHTML\DefaultIcon]
@="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe,0"

[HKEY_CLASSES_ROOT\ChromeHTML\Shell]

[HKEY_CLASSES_ROOT\ChromeHTML\Shell\open]

[HKEY_CLASSES_ROOT\ChromeHTML\Shell\open\command]
@="\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" -- \"%1\""

(Remove the (x86) part if your Chrome installation is actually in the plain Program Files folder.)

Now we need to make sure the association between the file extension and file type is correct. Go to HKEY_CLASSES_ROOT\.html and set the default value to ChromeHTML. That will change the value for your user account, but if you want to make sure it affects all users on the machine, update the version under HKLM as well. You will likely need to log off and back on to see the effect.

Ben N
  • 40,045
  • 17
  • 140
  • 181
  • I ran through and did this, restarted my PC, but I still have the broken icon :\. One strange thing I have noticed is that I'm running Chrome 64-bit but the file locations are in Program Files (x86). I haven't understood why. – DrZoo Apr 10 '17 at 15:26
  • That's just the way it is also on my computer, but I don't have any problem with the desktop icon. – harrymc Apr 10 '17 at 15:31
  • @DrZoo Hmm, interesting. What is the output of `assoc .html`? Also verify that the Chrome executable is exactly where my Registry fragment thinks it is. Does double-clicking the HTML file open it in Chrome? Do other users on the machine see the correct icon? – Ben N Apr 10 '17 at 15:33
  • @BenN My `chrome.exe` is at C:\Program Files(x86)\Google\Chrome\Application` like it is in your fragment. Double clicking the broken HTML thumbnail files does open them in Google Chrome too. In CMD the output of `assoc .html` is `.html=ChromeHTML` – DrZoo Apr 10 '17 at 15:38
  • @DrZoo Is the default value in `HKEY_CURRENT_USER\SOFTWARE\Classes\.html` any different? Also, do `.htm` files have the right icon? – Ben N Apr 10 '17 at 15:42
  • @BenN the HKCU .html and .htm are both ChromeHTML. `.htm` files also have the broken icon with Chrome. – DrZoo Apr 10 '17 at 15:45
  • @DrZoo Does anything change if you create a `DefaultIcon` subkey under `HKLM\SOFTWARE\Classes\.html` and set its default value to the same thing as is under `ChromeHTML`? What if you use *Open with*, choose to always use the selected program, and select Chrome's executable manually? Also try creating another user on the machine and logging into it to see if the same problem occurs. – Ben N Apr 10 '17 at 15:58
  • @BenN I tried creating the `DefaultIcon` and setting the default value to the same thing as ChromeHTML and it's still not working. I also tried manually going the the path of the `chrome.exe` with the open with property a while back. Doing so has the same result of a broken icon :\ I'll try to get someone else to log into an account later on today and see if they have the same issue. – DrZoo Apr 10 '17 at 16:08
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/56873/discussion-between-ben-n-and-drzoo). – Ben N Apr 10 '17 at 16:09
  • I awareded you with the bounty reward. Although the problem didn't work in my situation, it seems like the most likely option to work for someone else who may experience the same issue. – DrZoo Apr 17 '17 at 20:48
  • This did not work for me on Windows 10. – Ryan Oct 04 '18 at 17:04
2

I also had this issue months ago. I solved by reinstalling the Chrome. It fixed for me.

Aung Myat
  • 99
  • 2
  • 3
  • 12
  • I might try that again. I initially installed it with the offline installer, and then uninstalled and used the regular installer, but I had the same result. – DrZoo Apr 10 '17 at 04:37
0

If none of the solutions offered in the other answers has worked, and as the problem is not very critical, it is better to avoid solutions that menace the stability of your computer. I would suggest a workaround rather than a complete solution.

  • Right-click the shortcut
  • Choose Properties
  • Click the Change Icon ... button
  • Enter as the file name C:\\Program Files (x86)\Google\Chrome\Application\chrome.exe and then Enter
  • Click OK.

This should change the icon to that of Chrome. If this does not happen, then your Windows has a problem, but I do not think that this problem merits any more radical solution.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • I tried that too, but apparently you can only use the "Change Icon" option on the shortcut for the program. I tried this with multiple file extensions like `.html`, `.json`, `.js`, `.cpp`. None of them allowed me to change the icon image. I'm supposedly getting a new laptop in a few weeks so I'll just let it go and hope the same thing doesn't happen on the new one. Thanks for all of the suggestions! – DrZoo Apr 10 '17 at 20:36
  • Change Icon is not available for files that are *on* the desktop, and this will also happen on your new computer. You need to put instead the files in some other folder and use desktop shortcuts, rather than have them reside on the desktop. This is also better for backups. – harrymc Apr 10 '17 at 20:44
0

Try this

  1. open regedit from start Menu\ Run
  2. go to HKEY_CLASSES_ROOT
  3. go to ChromeHTML
  4. go to ShellEx
  5. then rename IconHandler
  6. log off or restart your PC.
Gazal
  • 1
  • 1