Windows script for enabling proxy and disabling it

medicnick83

Paramedic
Joined
Aug 23, 2006
Messages
21,158
Reaction score
565
Location
CBD, Cape Town
Hi all,

I went to help a person today with their printer and saw they had a windows script for enabling and disabling proxy on their PC.
They also used FortiClient for work related purposes.

Is anyone able to create this 'script' for me or show me how to do it?
Hers would pop up "Proxy ON" and "Proxy OFF"

We also use VPN/FortiClient but our users do it manually (enabling and disabling) and via control panel>internet options etc.

Would really appreciate it.

EDIT: Oh, I did ask if I could copy it, but she kindly said she can't share it (which I understand)
 
At elevated command prompt

Enable proxy : netsh winhttp set proxy :

Reset proxy : netsh winhttp reset proxy
 
Open a new Notepad.txt, copy the below contents to it, and save the .txt as a .vbs. Double-click the one you need to action.

Save as Enable.vbs

Code:
Const HKEY_CURRENT_USER = &H80000001

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"

strValueName = "ProxyEnable"
dwValue = 1
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue

Save as Disable.vbs

Code:
Const HKEY_CURRENT_USER = &H80000001

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"

strValueName = "ProxyEnable"
dwValue = 0
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue
 
Last edited:
Hi all,

I went to help a person today with their printer and saw they had a windows script for enabling and disabling proxy on their PC.
They also used FortiClient for work related purposes.

Is anyone able to create this 'script' for me or show me how to do it?
Hers would pop up "Proxy ON" and "Proxy OFF"

We also use VPN/FortiClient but our users do it manually (enabling and disabling) and via control panel>internet options etc.

Would really appreciate it.

EDIT: Oh, I did ask if I could copy it, but she kindly said she can't share it (which I understand)
You could also look at something like this if you don't want to go the script route...

https://www.proxyswitcher.com/download.html

The lite version is free...
 
Top
Sign up to the MyBroadband newsletter
X