Change bypass proxy for local address value using WMI

B

bill.finnerty

I am trying to add an entry into the exceptions for IE's proxy
settings. I found information on Microsoft's Hey, Scripting Guy!
website
(http://www.microsoft.com/technet/scriptcenter/resources/qanda/may05/hey0519.mspx)
that I modified to add the entry. When I look in the expections list
the entry is there, however IE seems to ignore it. If I manually add a
space and then delete it IE recognizes the addition. I have included
by script below. It is like the addition is saved but not applied.
Any ideas?

Dim KeyVals

Const HKEY_CURRENT_USER = &H80000001

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer &
"\root\default:StdRegProv")
Set oShell = CreateObject("WScript.Shell")

strKeyPath = "software\Microsoft\Windows\CurrentVersion\Internet
Settings"

strValueName = "ProxyOverride"
keyvals =
oShell.RegRead("HKCU\software\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyOverride")

If InStr(1,keyvals,"10.1.1.1",1)=0 THEN
keyvals = keyvals & "10.1.1.1"
objRegistry.setStringValue HKEY_CURRENT_USER, strKeyPath, strValueName,
keyvals
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top