鱼C论坛

 找回密码
 立即注册

笔记4

已有 527 次阅读2013-2-4 15:03 |个人分类:笔记

Option Explicit

Dim objShell, strKey, strProxyEnable, strProxyServer, strBypass, strBypassOld, strArr, strTmp, strRet
Dim strProxyIP, strBypassIP

'''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Change your needed IP here

strBypassIP = "10.190.34.179"  'Please use ';' to separate the bypass exception IPs

'''''''''''''''''''''''''''''''''''''''''''''''''''''''
strKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\"
strBypass = "ProxyOverride"

On Error Resume Next

' Create the Shell object
Set objShell = CreateObject("WScript.Shell")

' Set the bypass exception IP
' First get the old bypass list
strBypassOld = objShell.RegRead(strKey & strBypass)

strArr = Split(strBypassIP, ";", -1, 1)
For Each strTmp In strArr
strRet = InStr(strBypassOld, strTmp)
If strRet = 0 Then strBypassOld = strBypassOld & ";" & strTmp  
Next
If Left(strBypassOld, 1) = ";" Then strBypassOld = Mid(strBypassOld, 2)
' Set the bypass exception IP
objShell.RegWrite strKey & strBypass, strBypassOld, "REG_SZ"

WScript.Quit


路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-10-14 03:12

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

返回顶部