light_square

How To: Script System (IE) Proxy Settings

I’ve tested several ways to script System Proxy and found this solution works best. It uses a combination of Registry change, VBScript and a simple batch file to call each job. You will find many other solutions but this is guaranteed to work.

Here is what I did:
STEP 1
Create a new folder – I called it “VBScript-Proxy”
Create a new text file and insert the following: make sure you change the proxy url to the address for your proxy
dim oShell
set oShell = Wscript.CreateObject(“Wscript.Shell”)

if msgbox(“Turn Proxy on?”, vbQuestion or vbYesNo) = vbYes then
oShell.RegWrite “HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL”, “http://proxyurl.com/”, “REG_SZ”
oShell.RegWrite “HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride”, ““, “REG_SZ”
else
oShell.RegWrite “HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable”, 0, “REG_DWORD”
end if

Set oShell = Nothing
Save the Text file as: internet-proxy-on.vbs

In the same folder create a new text file and insert the following:
dim oShell
set oShell = Wscript.CreateObject(“Wscript.Shell”)

if msgbox(“Turn Proxy off?”, vbQuestion or vbYesNo) = vbNo then
oShell.RegWrite “HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable”, 1, “REG_DWORD”
else
oShell.RegWrite “HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable”, 0, “REG_DWORD”
oShell.RegWrite “HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL”, “”, “REG_SZ”
oShell.RegWrite “HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride”, “127.0.0.1″, “REG_SZ”
end if

Set oShell = Nothing

Save the text file as: internet-proxy-off

STEP 2
Create a new folder at the same file level as “VBScript-Proxy,” I named mine “Registry-Proxy”
Create a text file and insert the following:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections]
“DefaultConnectionSettings”=hex:46,00,00,00,4f,00,00,00,09,00,00,00,0a,00,00,\
00,70,72,6f,78,79,3a,38,30,38,30,09,00,00,00,31,32,37,2e,30,2e,30,2e,31,00,\
00,00,00,05,00,00,00,1f,00,00,00,68,74,74,70,3a,2f,2f,77,70,61,64,2e,6c,70,\
73,76,63,73,2e,63,6f,6d,2f,77,70,61,64,2e,64,61,74,e0,07,b8,87,de,22,cb,01,\
00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,17,00,00,00,00,00,00,00,fe,\
80,00,00,00,00,00,00,b1,f2,09,f5,f3,11,1f,8a,0e,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,54,00,b7,00,0a,00,23,29,39,03,00,10,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,0a,c3,\
04,f7,00,00,00,00,00,00,00,00,00,00,00,00,5c,00,b7,00,0a,00,23,29,27,03,00,\
10,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,64,00,b7,00,04,00,\
00,04,2d,03,00,00,68,c2,1f,00,70,69,19,00,00,00,00,00,00,00,00,00
“SavedLegacySettings”=hex:46,00,00,00,97,02,00,00,09,00,00,00,0a,00,00,00,70,\
72,6f,78,79,3a,38,30,38,30,09,00,00,00,31,32,37,2e,30,2e,30,2e,31,00,00,00,\
00,05,00,00,00,1f,00,00,00,68,74,74,70,3a,2f,2f,77,70,61,64,2e,6c,70,73,76,\
63,73,2e,63,6f,6d,2f,77,70,61,64,2e,64,61,74,e0,07,b8,87,de,22,cb,01,00,00,\
00,00,00,00,00,00,00,00,00,00,02,00,00,00,17,00,00,00,00,00,00,00,fe,80,00,\
00,00,00,00,00,b1,f2,09,f5,f3,11,1f,8a,0e,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,54,00,b7,00,0a,00,23,29,39,03,00,10,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,0a,c3,04,f7,\
00,00,00,00,00,00,00,00,00,00,00,00,5c,00,b7,00,0a,00,23,29,27,03,00,10,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,64,00,b7,00,04,00,00,04,\
2d,03,00,00,68,c2,1f,00,70,69,19,00,00,00,00,00,00,00,00,00

Save text file as: autoproxy-on.reg

Create a new text file and insert the following:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections]
“DefaultConnectionSettings”=hex:46,00,00,00,4d,00,00,00,01,00,00,00,0a,00,00,\
00,70,72,6f,78,79,3a,38,30,38,30,09,00,00,00,31,32,37,2e,30,2e,30,2e,31,00,\
00,00,00,01,00,00,00,1f,00,00,00,68,74,74,70,3a,2f,2f,77,70,61,64,2e,6c,70,\
73,76,63,73,2e,63,6f,6d,2f,77,70,61,64,2e,64,61,74,80,d6,8f,bc,d6,22,cb,01,\
00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,17,00,00,00,00,00,00,00,fe,\
80,00,00,00,00,00,00,b1,f2,09,f5,f3,11,1f,8a,0e,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,01,00,00,00,0c,3a,29,00,1c,3a,29,00,04,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,0a,c3,\
04,f7,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0a,00,00,\
00,00,00,00,00,30,56,28,00,70,3b,29,00,00,00,00,00,02,00,00,00,00,00,00,60,\
00,00,00,20,40,04,00,00,c0,39,29,00,02,00,00,00,80,09,00,00,40,04,00,00,c0,\
39,29,00,03,00,00,00,80,09,00,00,ea,b6,60,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
“SavedLegacySettings”=hex:46,00,00,00,91,02,00,00,01,00,00,00,0a,00,00,00,70,\
72,6f,78,79,3a,38,30,38,30,09,00,00,00,31,32,37,2e,30,2e,30,2e,31,00,00,00,\
00,01,00,00,00,1f,00,00,00,68,74,74,70,3a,2f,2f,77,70,61,64,2e,6c,70,73,76,\
63,73,2e,63,6f,6d,2f,77,70,61,64,2e,64,61,74,80,d6,8f,bc,d6,22,cb,01,00,00,\
00,00,00,00,00,00,00,00,00,00,02,00,00,00,17,00,00,00,00,00,00,00,fe,80,00,\
00,00,00,00,00,b1,f2,09,f5,f3,11,1f,8a,0e,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,\
00,00,00,0c,3a,29,00,1c,3a,29,00,04,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,0a,c3,04,f7,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0a,00,00,00,00,\
00,00,00,30,56,28,00,70,3b,29,00,00,00,00,00,02,00,00,00,00,00,00,60,00,00,\
00,20,40,04,00,00,c0,39,29,00,02,00,00,00,80,09,00,00,40,04,00,00,c0,39,29,\
00,03,00,00,00,80,09,00,00,ea,b6,60,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

Save the text file as: autoproxy-off.reg

STEP 3
Create two batch files at the same file level as the above two folders
Batch File 1, Create a new text file and insert the following:
%systemroot%\VBScript-proxy\internet-proxy-on.vbs
%systemroot%\Registry-proxy\AutoProxy-ON.reg

Save file as: proxyon.bat

Batch File 2, Create a new text file and insert the following:
%systemroot%\VBScript-proxy\internet-proxy-Off.vbs
%systemroot%\Registry-proxy\AutoProxy-Off.reg

Save file as: proxyoff.bat

Now to create a handy shortcut save both directories you created as well as the two batch files in %systemroot% (c:\Windows)

To turn on and off proxy you can activate from:
Start\Run – Type “proxyon” or “proxyoff,” without the quotes
or
you can type “proxyon” or “proxyoff,” without the quotes in any command prompt
or if your using windows 7 or vista you can type “proxyon” or “proxyoff,” without the quotes at start menu search.

I have copied a zipped version of this proxyon and off script here:
System Proxy Download

This script works with Safari as well:
System proxy + edits to work on Safari Download

Here is the Proxy changer for Firefox. No need for scripts, simple click “on” “off”
Firefox: QuickProxy

Leave a Comment