Tanmoy Datta
Tanmoy Datta

Reputation: 1644

Enable and Disable manual proxy setting in Windows 8

I want to enable and disable manual proxy setup in windows 7,8 and 8. I want to toggle the manual proxy setup option using command script. I want to create a .bat file using command line and whenever I click on that .bat file, the manual proxy setup option will be toggled. I don't know the command for doing my job. I want to know the command for this job. Required toggle option is marked

Upvotes: 1

Views: 7802

Answers (2)

VeRo
VeRo

Reputation: 1111

I agree with @Quirk this question is better placed in the super user group, but at the same time, users are drawn more often to StackOverflow and get discouraged when they don't find the answer.

Here is something I came up with, also my taught process:

  1. all of Windows configurations that are flags or simple values are kept in the registry
  2. you can manipulate the registry with the REG command
  3. REG /? shows you what you can do
  4. with regedit you can search the registry (F3) for your proxy host name

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settingsenter image description here

  5. once you found the REG_KEY you are ready to write your script

in conclusion:

here is your 'command' for enabling your proxy:

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f

here is your 'command' for disabling your proxy:

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f

It works, the value is set, but I am pretty sure your Network Settings Window does not get the update until the next time you open it.

Hope this helps.

Upvotes: 4

DavidPostill
DavidPostill

Reputation: 7921

I want to enable and disable manual proxy setup

To enable:

netsh winhttp set proxy myproxy:80

To disable:

netsh winhttp reset proxy

To show the current settings:

netsh winhttp show proxy

Further Reading

Upvotes: 2

Related Questions