Windows

3 Useful Scripts to Modify Proxy Settings in Internet Explorer and Microsoft Edge

James Hirtz Updated 09-03-2020

Do you ever worry about your online identity? One thing people do to protect their identity online is to make use of proxy servers. Anonymous proxy servers hide your real IP, which is useful if you’re unable to access different sites or need added privacy.

Advertisement

Still, manually switching your browser’s proxy settings based on location (whether your home or office) can quickly become a hassle. To save time, you can use a script to change proxy settings on Windows 10.

Don’t worry if you aren’t a programmer, it just takes a little knowledge. With these three useful scripts, you can easily modify your proxy settings for your browser.

Configure a Proxy Server Manually

Before we get into the ways that you can automate your computer through scripting, let’s take a quick look at the manual way people can do this. Maybe, you already know how to test your home network speed How to Test Your Home Network Speed (And Decipher the Results) Think your internet isn't fast enough? The problem might not be with your ISP! Here's how to run a network speed test at home. Read More —it’s one of the first things you should check if you’re ever having Internet connection problems.

However, not everyone has explored their Local Area Network (LAN) settings on Internet Explorer or Microsoft Edge.

Typically, you want your proxy settings to be set to Automatically detect settings when you’re at home or at a public hotspot. However, at work, you’ll want to set up a proxy server. Depending on whether you’re using Internet Explorer or Microsoft Edge, how you get to your settings will differ.

Advertisement

Check Proxy Server Settings on Internet Explorer

Proxy Server Settings on Internet Explorer

Follow these steps to get access to your proxy server settings on Internet Explorer:

  1. Open Internet Explorer.
  2. Press Alt+X and scroll down to Internet options.
  3. Click on the Connections tab.
  4. Press the LAN settings button.
  5. Modify your proxy server settings as needed.

Under Local Area Network (LAN) settings, you either have a proxy server turned on or off. This is the setting that you want to toggle when you switch from your home network to a work network. You can also use it if you want to switch to running under a “cloaked” anonymous IP server.

LAN Settings on your computer

Advertisement

Check Proxy Server Settings on Microsoft Edge

Unlike Internet Explorer, Microsoft Edge manages its proxy settings under Windows 10’s Network & Internet settings. For the fastest way to access your proxy server options for Microsoft Edge, follow these steps:

  1. Press the Windows start button.
  2. Press the gear icon to open Settings.
  3. Click on Network & Internet.
  4. On the left side-bar, click on Proxy.
  5. Adjust your proxy setup as needed.

Proxy Server Settings on Microsoft Edge

Proxy Registry Settings

As an alternative, you can also find these proxy settings in your Registry Editor (Type regedit into the Run app). This is what you want your proxy scripts to edit. By changing the registry settings, you’re essentially changing those settings in the LAN Settings window.

Proxy Registry Settings

Advertisement

If you still have questions on what is a proxy server What Is a Proxy Server? Heard the term "proxy server" but have no idea what it means? Here's how a proxy can help beat region blocking and more. Read More , it can help to brush up before diving into these scripts.

Three Ways to Use VBScript to Change Proxy Settings

When using scripts, you need to only toggle those settings when and where you want to. There are three scenarios that these scripts will cover, but you can tweak the code to your liking. You can put the script in your startup folder so that it launches whenever you boot your computer, or you can just run the scripts whenever you want your computer to automatically set the correct IP settings.

The three ways these scripts will function include:

  1. It prompts the user to enable an anonymous proxy for Internet access.
  2. It prompts the user to type in the name of the proxy server they want to use.
  3. It automatically checks whether you’re home (or not) and sets the appropriate proxy server settings.

The cool thing about Windows Scripting Host is that each of these options isn’t that hard to do.

Advertisement

1. Ask User to Enable a Proxy Server

This script will pop-up a message box asking whether or not the user wants to use a proxy server. If yes, then the script will enable proxy servers and fill in a hard-coded anonymous proxy server. You need to tweak the script to use your anonymous proxy.

With that said, here’s what the script looks like. Make sure to locate the placeholder address and port (http://www.youareanonymous.com:80) and replace it below.

Option Explicit
Dim valUserIn
Dim objShell, RegLocate, RegLocate1
Set objShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
valUserIn = MsgBox("Use A Cloaked Proxy?",4,"Cloaked Select")
If valUserIn=vbYes Then
RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"
objShell.RegWrite RegLocate,"http://www.youareanonymous.com:80","REG_SZ"
RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
objShell.RegWrite RegLocate,"1","REG_DWORD"
MsgBox "Cloaked Proxy is Enabled"
else
RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"
objShell.RegWrite RegLocate,"0.0.0.0:80","REG_SZ"
RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
objShell.RegWrite RegLocate,"0","REG_DWORD"
MsgBox "Cloaked Proxy is Disabled"
End If
WScript.Quit

Simply copy and paste the above script into a blank Notepad file. Then save it with a .vbs extension (i.e. ask_user.vbs). When you run it, you’ll see the following prompt.

use a cloaked proxy prompt

A “Yes” loads the specified proxy as your proxy server and sets “ProxyEnable” to 1. A “No” sets the proxy to the default (all zeros) and disables the proxy setting.

2. Prompt User to Type Proxy

The other approach is to ask the user what exact server they want to use. This allows the flexibility of changing the proxy server constantly without the need to edit the script itself. You can do this by simply changing the “MsgBox” command in the original code to an “InputBox.”

Option Explicit
Dim valUserIn
Dim objShell, RegLocate, RegLocate1
Set objShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
valUserIn = Inputbox("Enter the Proxy server you want to use.","Proxy Server Required")
RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"
objShell.RegWrite RegLocate,valUserIn,"REG_SZ"
RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
objShell.RegWrite RegLocate,"1","REG_DWORD"
MsgBox "Proxy is Enabled"
WScript.Quit

Once again, paste the contents into Notepad and save the file with a .vbs extension. When you save this as a .vbs file and run it, the following window will appear.

manual entry for cloaked proxy

Just type in your preferred proxy server, click okay, and your Internet settings automatically update.

3. Set Proxy Settings Based on Location

This next script is a bit more flexible, so it’s also a little longer. But what it can do is check your current IP address. If it is within the expected range when you’re on your home IP, it won’t use a proxy server.

If it appears you’re not on your typical home IP, it’ll automatically configure your Internet with a proxy server that you can hard code into the script. Simply copy this script into a Notepad file and save it with a .vbs extension to try it out.

Option Explicit

Dim valUserIn
Dim objShell, RegLocate, RegLocate1
Dim objRemXML
Dim objMyIP
Dim strIPAddress
Dim strHostname
Dim strHomeDomain

On Error Resume Next

Set objShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next

Const cstrShowMyIP = "http://www.showmyip.com/xml/"

Set objRemXML = CreateObject("Microsoft.XMLDOM")
objRemXML.async = False
objRemXML.load(cstrShowMyIP)

' Get our IP address
Set objMyIP = objRemXML.selectSingleNode("/ip_address/ip")
strIPAddress = objMyIP.text

' Print info

strHomeDomain = Left (strIPAddress,6)

If strHomeDomain = "69.161" then

RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"
objShell.RegWrite RegLocate,"0.0.0.0:80","REG_SZ"

RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
objShell.RegWrite RegLocate,"0","REG_DWORD"

MsgBox "Cloaked Proxy is Disabled"

else

RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"
objShell.RegWrite RegLocate,"http://www.youareanonymous.com:80","REG_SZ"

RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
objShell.RegWrite RegLocate,"1","REG_DWORD"

MsgBox "Cloaked Proxy is Enabled"

end if

' Finish
Set objMyIP = Nothing
Set objRemXML = Nothing

WScript.Quit 

When you run it at home, it recognizes your home IP and disables the anonymous proxy.

disabled cloaked proxy

If you were on a public hotspot, it would recognize the foreign IP address and enable the cloaked proxy instead. Just remember to change out the placeholder proxy since it’s a longer code.

Utilizing Windows 10 Proxy Scripts

These are just a few examples of the sort of automation you can implement on your Windows PC with Windows Scripting Host. You don’t have to be an expert programmer! Just learn a few of the commands in these scripts, and you can really work some magic.

Still, if you’re not ready for proxy by scripts, there are alternatives. Check out our best web proxies for geo-blocked content and online privacy The 15 Best Web Proxies for Geo-Blocked Content and Online Privacy Want to circumvent geo-blocking or mask your online activity? You'll need one of these free web proxies. Read More . If you don’t want to deal with the scripting stress, you just have to use your browser instead.

Explore more about: Internet Explorer, Microsoft Edge, Proxy, Scripting.

Whatsapp Pinterest

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. BEVERLY WHATLEY
    March 10, 2020 at 11:08 pm

    IF I DOWN LOAD WORD PAD WHAT WILL BE THE COST?BEVERLY WHATLEY

  2. Marjan
    December 14, 2016 at 5:48 pm

    Thank you very much. I was looking for a way to turn proxy on/off with just one click. This is the script, based on the above. Paste it in a notepad and save it as .vbs. Running it will popup yes/no window. Yes turns proxy on, no turns it off. Simple as that. Cheers!

    Option Explicit
    Dim valUserIn
    Dim objShell, RegLocate
    Set objShell = WScript.CreateObject("WScript.Shell")

    On Error Resume Next
    valUserIn = MsgBox("Proxy?",4)

    If valUserIn=vbYes Then
    RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
    objShell.RegWrite RegLocate,"1","REG_DWORD"

    else
    RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
    objShell.RegWrite RegLocate,"0","REG_DWORD"
    End If
    WScript.Quit

    • Sammy
      May 9, 2017 at 3:27 pm

      I am trying to use this script to enable and disable "Use automatic configuration script" But I can not find the regkey for that setting, any ideas?

    • Leya George
      April 28, 2020 at 5:08 pm

      Hi Marjan,

      Can you please provide me the script for the below need:
      Each time when i login to my office laptop, the LAN settings in IE browser gets changed and i need to enable 'Automatic detect settings' option and disable the option under that to access the URL i need.
      Do you have any option/script to automate this?

  3. Edinra
    August 10, 2016 at 10:12 am

    hi,
    I tried to use the first script, but it is used only to check and uncheck the proxy. It doesnt process it.
    Once I disable this means, again i open new tab, its not disabled..

    The problem is there is no code for pressing enter key.

    The OK button in proxy.

    Please any one help.

  4. snehal
    July 4, 2016 at 1:06 pm

    I tried script 1, it works but new proxy setting are not applied till I restart internet explorer. Any idea?

  5. Bala
    January 21, 2016 at 8:17 am

    hi This is bala,

    My client system didnot get the automatic proxy script. We have to enable manually. what could i do....

  6. rhabanna
    November 24, 2015 at 4:26 pm

    Thanks for this. Would you happen to know how to get the checkbox next to "use automatic proxy" checked using the prompt user to set proxy script? It works fine but does not check the box so explorer will not address the auto proxy that it set.

  7. Jalel
    May 24, 2015 at 8:09 pm

    Thanks for this post I found it helpful.
    I was looking for a script to just enable or disable the proxy. I switch too often this option and wanted to automate it.
    I modified the first script to just modify the RegLocate = "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsProxyEnable"
    I removed the other RegLocate statements.
    *Jalel

  8. jim
    April 23, 2015 at 7:13 pm

    Appreciate the tip, needed to update an exclusions list. This worked perfectly.

  9. Shreejeet
    April 13, 2015 at 4:26 am

    Hi Ryan,

    Thanks, This is what I'm looking for but I'm trying to do same thing using C#.
    Is it possible to use this?

  10. Anonymous
    February 6, 2011 at 10:29 pm

    Thanks Tim - that's right, the "textarea" tag shouldn't be there, only the text within the tags, thanks for catching that.

  11. rdube02
    February 6, 2011 at 11:29 pm

    Thanks Tim - that's right, the "textarea" tag shouldn't be there, only the text within the <job> tags, thanks for catching that.</job>

  12. Anonymous
    February 6, 2011 at 4:34 pm

    @James888
    I noticed that the first script in the article has a tag hanging at the end. That is likely a remnant of the author cut/paste operation and shouldn't be there. I'm not on a Windows machine to test right now but I would assume that error would cause the VB compiler to fail, as you're seeing. Remove that last tag and try it again.

  13. timpala
    February 6, 2011 at 5:34 pm

    @James888
    I noticed that the first script in the article has a tag hanging at the end. That is likely a remnant of the author cut/paste operation and shouldn't be there. I'm not on a Windows machine to test right now but I would assume that error would cause the VB compiler to fail, as you're seeing. Remove that last tag and try it again.

  14. Anonymous
    December 31, 2010 at 6:23 am

    Ask User To Enable A Proxy Server script. I put the script in and it has an error.

    Script: C:...
    Line: 1
    Char: 1
    Error: Expected statement
    Code: 800A0400
    Source: Microsoft VBScript compilation error

    Im dont know VBS script to well so I couldnt fix it. Looked it up and read the obvious, that there is an error with the first line. Im going to continue to try and get it working.
    If anyone knows whats wrong please post in comments.

  15. james888
    December 31, 2010 at 7:23 am

    Ask User To Enable A Proxy Server script. I put the script in and it has an error.

    Script: C:\...
    Line: 1
    Char: 1
    Error: Expected statement
    Code: 800A0400
    Source: Microsoft VBScript compilation error

    Im dont know VBS script to well so I couldnt fix it. Looked it up and read the obvious, that there is an error with the first line. Im going to continue to try and get it working.
    If anyone knows whats wrong please post in comments.

  16. jrmbtr
    December 30, 2010 at 2:07 am

    How do you find a good proxy? Any that I try won't work with most sites.

  17. saurabh
    December 29, 2010 at 10:35 pm

    that's some cool stuff..but will it be ok for an ordinary user to keep editing his regedit through scripts all the time? Will he be able to fix some issue that may crop up?

  18. saurabh
    December 29, 2010 at 11:35 pm

    that's some cool stuff..but will it be ok for an ordinary user to keep editing his regedit through scripts all the time? Will he be able to fix some issue that may crop up?