htm和html文件不显示图标的解决
htm和html文件不显示图标
不论是IE还是其它的浏览器,比如360安全浏览器,只要将它们设置为默认浏览器,它们都会将htm及html文件的图标改为自己相应的图标。以便确认是用该浏览器打开的。但是经常会发生文件图标突然改变为无关联文件的图标。经过反复的试验,各种程序包括注册
清理工具及360安全的清理工具,都没有造成这种改变。主要是浏览网页时,网页的设置尤其插件,可能改变了有关的注册表设置而造成的。不仅改变了图标,也会使浏览器的性能受到影响,比如下载功能的丢失......。这很难避免,而且有非常大的偶然性,防不胜防。 仅就文件图标来说,经过试验,不论是IE还是360安全浏览器,恢复图标的最有效的办法倒是:
先将注册表中 HKEY_CLASSES_ROOT\htmlfile\ShellEx\ IconHandler子项删除,再重新通过编辑文件类型来更改图标(双击我的电脑--工具--文件夹选项--文件类型--找到hem\heml扩展名--高级--更改图标)。IE是默认浏览器时它们的图标就是C:\Program Files\Internet
Explorer\IEXPLORE.EXE的图标;而360安全浏览器成为默认浏览器时它们的图标是C:\WINDOWS\system32\url.dll的图标。比如下面的图示是我们恢复360安全浏览器的图标,这中间可以遇到“找不到%1的错误”提示,不用管它。
图1
图2
不用管它,按“确定”,然后在更改图标的对话框中点击“浏览”找到url.dll所在的文件位置,出现一系列的图标,如图选那个默认的,带红星号的,再点击对话框的确定,就好了。
图3
这个方法对IE6,IE8以及360安全浏览器都试过,很灵的。记住一定要先将注册表中 HKEY_CLASSES_ROOT\htmlfile\ShellEx\ IconHandler子项删除~
当然也可以直接通过修改注册表来完成,例如可以通过下面的适当的reg文件直接导入注册表值就可以了。
【有关这两个文件图标的的注册表项】
如果你愿意从注册表下手,也很方便。下面是有关注册表的正常设置值。 当没有安装360安全浏览器时,我的默认Web浏览器是IE8。这时的注册表有关设置如下: 而导出的htmlfile如下:
htmlfileIE8.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.htm]
@="htmlfile"
"Content Type"="text/html"
"PerceivedType"="text"
[HKEY_CLASSES_ROOT\.htm\OpenWithList]
[HKEY_CLASSES_ROOT\.htm\OpenWithList\notepad.exe]
[HKEY_CLASSES_ROOT\.html]
@="htmlfile"
"Content Type"="text/html"
"PerceivedType"="text"
[HKEY_CLASSES_ROOT\htmlfile]
@="HTML Document"
"FriendlyTypeName"="@C:\\WINDOWS\\system32\\ieframe.dll.mui,-912" "EditFlags"=dword:00000000
[HKEY_CLASSES_ROOT\htmlfile\BrowseInPlace]
@=""
[HKEY_CLASSES_ROOT\htmlfile\CLSID]
@="{25336920-03F9-11cf-8FD0-00AA00686F13}"
[HKEY_CLASSES_ROOT\htmlfile\DefaultIcon]
@="C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE,-17"
[HKEY_CLASSES_ROOT\htmlfile\ScriptHostEncode] @="{0CF774D0-F077-11D1-B1BC-00C04F86C324}"
[HKEY_CLASSES_ROOT\htmlfile\shell]
@="opennew"
[HKEY_CLASSES_ROOT\htmlfile\shell\open]
@="Open in S&ame Window"
"MUIVerb"="@C:\\WINDOWS\\system32\\ieframe.dll.mui,-5732"
[HKEY_CLASSES_ROOT\htmlfile\shell\open\command] @="\"C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE\" -nohome"
[HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec] @="\"file://%1\",,-1,,,,,"
"NoActivateHandler"=""
[HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec\Application] @="IExplore"
[HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec\Topic]
@="WWW_OpenURL"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew]
"MUIVerb"="@C:\\WINDOWS\\system32\\ieframe.dll.mui,-5731" @="&Open"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\command] @="\"C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE\" %1"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec] @="\"%1\",,-1,0,,,,"
"NoActivateHandler"=""
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec\Application] @="IExplore"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec\IfExec] @="*"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec\Topic] @="WWW_OpenURLNewWindow"
[HKEY_CLASSES_ROOT\htmlfile\shell\print]
[HKEY_CLASSES_ROOT\htmlfile\shell\print\command]
@="\"C:\\WINDOWS\\system32\\rundll32.exe\"
\"C:\\WINDOWS\\system32\\mshtml.dll\",PrintHTML \"%1\""
[HKEY_CLASSES_ROOT\htmlfile\shell\printto]
[HKEY_CLASSES_ROOT\htmlfile\shell\printto\command] @="\"C:\\WINDOWS\\system32\\rundll32.exe\"
\"C:\\WINDOWS\\system32\\mshtml.dll\",PrintHTML \"%1\" \"%2\" \"%3\" \"%4\""
[HKEY_CLASSES_ROOT\ htmlfile \ShellEx]
[-HKEY_CLASSES_ROOT\ htmlfile\ShellEx\IconHandler]
原来的IE6相应的注册表设置如下:
htmlfileIE6.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.htm]
@="htmlfile"
"Content Type"="text/html"
"PerceivedType"="text"
[HKEY_CLASSES_ROOT\.htm\OpenWithList]
[HKEY_CLASSES_ROOT\.htm\OpenWithList\notepad.exe]
[HKEY_CLASSES_ROOT\.html]
@="htmlfile"
"Content Type"="text/html"
"PerceivedType"="text"
[HKEY_CLASSES_ROOT\htmlfile]
@="HTML Document"
"EditFlags"=dword:00000000
[HKEY_CLASSES_ROOT\htmlfile\BrowseInPlace] @=""
[HKEY_CLASSES_ROOT\htmlfile\CLSID]
@="{25336920-03F9-11cf-8FD0-00AA00686F13}"
[HKEY_CLASSES_ROOT\htmlfile\DefaultIcon]
@=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,00,46,\
00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,65,00,\
74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,00,65,\
00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,31,00,\
00,00
[HKEY_CLASSES_ROOT\htmlfile\ScriptHostEncode]
@="{0CF774D0-F077-11D1-B1BC-00C04F86C324}"
[HKEY_CLASSES_ROOT\htmlfile\shell]
@="opennew"
[HKEY_CLASSES_ROOT\htmlfile\shell\open]
@="在同一窗口中打开(&A)"
"MUIVerb"="@C:\\WINDOWS\\system32\\ieframe.dll.mui,-5732"
[HKEY_CLASSES_ROOT\htmlfile\shell\open\command] @="\"C:\\Program Files\\internet explorer\\iexplore.exe\" \"%1\""
[HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec] @="\"file://%1\",,-1,,,,,"
"NoActivateHandler"=""
[HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec\Application] @="IExplore"
[HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec\Topic]
@="WWW_OpenURL"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew]
"MUIVerb"="@C:\\WINDOWS\\system32\\ieframe.dll.mui,-5731" @="打开(&O)"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\command] @="\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" %1"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec] @="\"%1\",,-1,0,,,,"
"NoActivateHandler"=""
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec\Application] @="IExplore"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec\IfExec] @="*"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec\Topic] @="WWW_OpenURLNewWindow"
[HKEY_CLASSES_ROOT\htmlfile\shell\print]
[HKEY_CLASSES_ROOT\htmlfile\shell\print\command]
@=hex(2):72,00,75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,\
00,20,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,\
25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,73,\
00,68,00,74,00,6d,00,6c,00,2e,00,64,00,6c,00,6c,00,2c,00,50,00,72,00,69,00,\
6e,00,74,00,48,00,54,00,4d,00,4c,00,20,00,22,00,25,00,31,00,22,00,00,00
[HKEY_CLASSES_ROOT\htmlfile\shell\printto]
[HKEY_CLASSES_ROOT\htmlfile\shell\printto\command] @=hex(2):72,00,75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,\
00,20,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,\
25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,73,\
00,68,00,74,00,6d,00,6c,00,2e,00,64,00,6c,00,6c,00,2c,00,50,00,72,00,69,00,\
6e,00,74,00,48,00,54,00,4d,00,4c,00,20,00,22,00,25,00,31,00,22,00,20,00,22,\
00,25,00,32,00,22,00,20,00,22,00,25,00,33,00,22,00,20,00,22,00,25,00,34,00,\
22,00,00,00
[HKEY_CLASSES_ROOT\ htmlfile \ShellEx]
[-HKEY_CLASSES_ROOT\ htmlfile\ShellEx\IconHandler]
安装360安全浏览器后,它替代IE而成为默认浏览器,自动地更改了.htm和.html文件的默
认打开方式。有关的注册表改变,导出如下: 360seURL.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.htm]
@="360seURL"
"Content Type"="text/html"
"PerceivedType"="text"
[HKEY_CLASSES_ROOT\.htm\OpenWithList]
[HKEY_CLASSES_ROOT\.htm\OpenWithList\notepad.exe]
[HKEY_CLASSES_ROOT\.html]
@="360seURL"
"Content Type"="text/html"
"PerceivedType"="text"
[HKEY_CLASSES_ROOT\360seURL] @="360seURL"
[HKEY_CLASSES_ROOT\360seURL\DefaultIcon] @="C:\\WINDOWS\\system32\\url.dll,0"
[HKEY_CLASSES_ROOT\360seURL\shell] @="open"
[HKEY_CLASSES_ROOT\360seURL\shell\Edit] @="&Edit"
[HKEY_CLASSES_ROOT\360seURL\shell\Edit\command] @="\"C:\\Program Files\\Microsoft Office\\OFFICE11\\msohtmed.exe\" %1"
[HKEY_CLASSES_ROOT\360seURL\shell\open]
[HKEY_CLASSES_ROOT\360seURL\shell\open\command]
@="\"C:\\Program Files\\360\\360se\\360SE.exe\" \"%1\""
[HKEY_CLASSES_ROOT\360seURL\shell\Print]
@="&Print"
[HKEY_CLASSES_ROOT\360seURL\shell\Print\command] @="\"C:\\Program Files\\Microsoft Office\\OFFICE11\\msohtmed.exe\" /p %1"
[HKEY_CLASSES_ROOT\360seURL\ShellEx]
[-HKEY_CLASSES_ROOT\360seURL\ShellEx\IconHandler]
你完全可以将这些内容制作相应的reg文件,必要修复图标时,通过reg文件把正确的设置导入注册表,重新启动计算机准没有问
了。