天寒地冻请求大神贴出VB修改默认浏览器为IE的代码,非常感谢!

冰天雪地请求大神贴出VB修改默认浏览器为IE的代码,非常感谢!!
冰天雪地请求大神贴出VBA修改默认浏览器为IE的代码,非常感谢!!

EXCEL HOME 似乎无人回答哦 希望此宝地能有能人指教,非常感谢!!

PS:我使用VBA的 不过代码应该通用 ^^

------解决方案--------------------
没有测试,试试看。

首先找到机器上 IE 执行文件的路径,如

Dim strIEPath As String

strIEPath = ""C:\Program Files\Internet Explorer\IEXPLORE.EXE""

注意,引号是需要的。

然后写注册表:

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegWrite "HKCR\http\shell\open\command\" & strIEPath & " -nohome"
WshShell.RegWrite "HKCR\http\shell\open\ddeexec\Application\IExplore"

Set WshShell = Nothing
------解决方案--------------------
Set WshShell = CreateObject("WScript.Shell")