- Option Explicit
-
- Dim wso, http, url, html, re, matchs, m, s
- Set wso = CreateObject("WScript.Shell")
- Set http = CreateObject("microsoft.xmlhttp")
-
- '获取url网页内容
- url = "https://freepac.co/"
- http.open "GET", url, False
- http.send
- html = http.responseText
-
- '提取网页中的字符串
- Set re = New RegExp
- re.Global = True
- re.Pattern = "free.upac.pro/([0-9,a-z]*)"
- re.IgnoreCase = True
- Set matchs = re.Execute(html)
- If matchs.Count > 0 Then
- s = matchs.Item(0).Submatches(0) '提取第一个匹配项
- '写入注册表
- wso.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL", url & s, "REG_SZ"
- End If
-
- '打开IE代理设定界面
- wso.Run "control inetcpl.cpl,,4", 1, False
- wso.AppActivate "internet"
- WScript.Sleep 500
- wso.Sendkeys "%L"
复制代码
|