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.
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—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.
Check Proxy Server Settings on Internet Explorer
Follow these steps to get access to your proxy server settings on Internet Explorer:
- Open Internet Explorer.
- Press Alt+X and scroll down to Internet options.
- Click on the Connections tab.
- Press the LAN settings button.
- 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.
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:
- Press the Windows start button.
- Press the gear icon to open Settings.
- Click on Network & Internet.
- On the left side-bar, click on Proxy.
- Adjust your proxy setup as needed.
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.
If you still have questions on what is a proxy server, 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:
- It prompts the user to enable an anonymous proxy for Internet access.
- It prompts the user to type in the name of the proxy server they want to use.
- 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.
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 (https://ift.tt/2IyaFib) 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.
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.
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.
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. If you don’t want to deal with the scripting stress, you just have to use your browser instead.
Read the full article: 3 Useful Scripts to Modify Proxy Settings in Internet Explorer and Microsoft Edge
Read Full Article
No comments:
Post a Comment