WMI script to change IE Proxy settings

B

bill.finnerty

I found information on Microsoft's Hey, Scripting Guy! website
(http://www.microsoft.com/technet/scriptcenter/resources/qanda/may05/hey0519.mspx)
that I used to write a script that adds an entry to IE's proxy
exceptions list. When run, the script adds the entry but IE does not
recognize it. If I manually add a space in and then remove it, IE
recognizes the additional entry. It is like the entry is saved but not
applied, if that makes any sense. I have included the script below.
Any ideas? Thanks in advance.

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,"172.16.48.30",1)=0 THEN
keyvals = keyvals & "172.16.48.30"
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