The following script disables/enables Proxy (Checks/unchecks) proxy config
'HKEY_CURRENT_USER is represented by this value
'**********************************************
Const HKCU = &H80000001
'Local computer is represented by dot(.)
'**********************************************
strSystem = "."
'Binding WMI service-namespace and registry class (stdRegProv)
'*************************************************************
Set objRegEdit = GetObject("winmgmts:\\" & strSystem & "\root\default:StdRegProv")
'IE Path in the Registry
'*********************
strRegistryPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"
'Name of Key
'************
strKeyName = "ProxyEnable"
'Read the value of Proxy setting [enabled or disabled]
'*****************************************************
objRegEdit.GetDWORDValue HKCU,strRegistryPath,strKeyName,dbwv
'Check if it is Enabled
'**********************
if dbwv=1 then
if msgbox("Disable proxy?",3,"IE_Proxy_Settings.vbs") = 6 then
DWORDValue=0
objRegEdit.SetDWORDValue HKCU, strRegistryPath, strKeyName, DWORDValue
if err.number = 0 then
msgbox "Proxy is disabled"
else
msgbox "Error in Disabling the proxy"
end if
end if
'Check if it is Disabled
'***********************
elseif dbwv=0 then
if msgbox("Enable proxy?",3,"IE_Proxy_Settings.vbs") = 6 then
DWORDValue=1
objRegEdit.SetDWORDValue HKCU, strRegistryPath, strKeyName, DWORDValue
if err.number = 0 then
msgbox "Proxy is enabled"
else
msgbox "Error in enabling the proxy"
end if
end if
end if
'Destruct the object used
'************************
Set ObjRegEdit = Nothing
it works perfectly on IE 6, however it doesnt on IE7. Any suggestions ?