• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

Creating a VB script for pointing a computer to a proxy server

Hi guys,

Forgive my lack of knowledge but I don't have an in depth knowledge of VB. I want to create a VB script which will allow me to point a computer to a proxy server based on its subnet. How might I go about creating this?

Thanks very much for your time,

Kind regards,

1 Solution
Make a new text document, and paste the following code:

Set oShell = CreateObject("Wscript.Shell")
RegKeyPath = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\"
oShell.RegWrite RegKeyPath & "ProxyServer", WScript.Arguments.Item(0), "REG_SZ"
oShell.RegWrite RegKeyPath & "ProxyEnable", "1", "REG_DWORD"

Rename the txt file to a .vbs file. You can normally double click it to run, but in this case, you will have to run it as a command line...

  SetProxyPath.vbs "www.MyNewProxy.com"

It will set that path as the proxy server, and enable the proxy setting.

Hope this is what you wanted
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now