Changing proxy settings on IE
Discussion
Can you automate turning the proxy server settings on and off in IE?
I wrote a registry entry (shown below) but it doesn't work... (ip's edited)
REGEDIT
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyServer"="111.111.11.11:8080"
"ProxyEnable"=dword:00000001
"ProxyOverride"="123.456.1.1"
I wrote a registry entry (shown below) but it doesn't work... (ip's edited)
REGEDIT
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyServer"="111.111.11.11:8080"
"ProxyEnable"=dword:00000001
"ProxyOverride"="123.456.1.1"
Thanks for the replies, a bit of googling revealed this tidy little html...
Paste into notepad and save as proxychanger.htm
Paste into notepad and save as proxychanger.htm
html code said:
<html>
<head>
<title>ProxySwitcher by CrazyMatt</title>
</head>
<HTA:APPLICATION
SysMenu="no"
ID="objAutoRefresh"
SCROLL="no"
SINGLEINSTANCE="yes"
>
<SCRIPT LANGUAGE="VBScript">
Sub Window_OnLoad
const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
strValueName = "ProxyEnable"
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
strTEXT = dwValue
If strTEXT < 1 Then
DataArea.InnerHTML = "IE Proxy is OFF"
Else
DataArea.InnerHTML = "IE Proxy is ON"
end If
End Sub
Sub Proxy
const HKEY_CURRENT_USER = &H80000001
strComputer = "." 'sets local computer
Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
strValueName = "ProxyEnable"
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
strTEXT = dwValue
If strTEXT < 1 Then
strValue = 1
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
'This turns the proxy on by setting the reg dwvalue to 1
Else
strValue = 0
'This turns the proxy off by setting the reg dwvalue to 0
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
end If
location.reload( True )
end Sub
Sub ExitProgram
window.close()
End Sub
Sub bodyLoaded()
window.ResizeTo 176,140 ' WIDTH, HEIGHT
End Sub
</script>
<body onLoad="bodyLoaded()" STYLE="font:12 pt arial; color:white;
filterrogid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr='#000000', EndColorStr='#0000FF')">
<P align=center>
<span id = "DataArea"></span><BR>
<input id=runbutton type="button" value="Proxy On/OFF" onClick="Proxy"><BR><BR>
<input id=runbutton type="button" value="Exit" onClick="ExitProgram">
</P>
</body>
</html>
<head>
<title>ProxySwitcher by CrazyMatt</title>
</head>
<HTA:APPLICATION
SysMenu="no"
ID="objAutoRefresh"
SCROLL="no"
SINGLEINSTANCE="yes"
>
<SCRIPT LANGUAGE="VBScript">
Sub Window_OnLoad
const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
strValueName = "ProxyEnable"
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
strTEXT = dwValue
If strTEXT < 1 Then
DataArea.InnerHTML = "IE Proxy is OFF"
Else
DataArea.InnerHTML = "IE Proxy is ON"
end If
End Sub
Sub Proxy
const HKEY_CURRENT_USER = &H80000001
strComputer = "." 'sets local computer
Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
strValueName = "ProxyEnable"
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
strTEXT = dwValue
If strTEXT < 1 Then
strValue = 1
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
'This turns the proxy on by setting the reg dwvalue to 1
Else
strValue = 0
'This turns the proxy off by setting the reg dwvalue to 0
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
end If
location.reload( True )
end Sub
Sub ExitProgram
window.close()
End Sub
Sub bodyLoaded()
window.ResizeTo 176,140 ' WIDTH, HEIGHT
End Sub
</script>
<body onLoad="bodyLoaded()" STYLE="font:12 pt arial; color:white;
filterrogid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr='#000000', EndColorStr='#0000FF')">
<P align=center>
<span id = "DataArea"></span><BR>
<input id=runbutton type="button" value="Proxy On/OFF" onClick="Proxy"><BR><BR>
<input id=runbutton type="button" value="Exit" onClick="ExitProgram">
</P>
</body>
</html>
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff