Whenever I connect to a corporate VPN it always sets a proxy server. It is necessary for corporate WiFi but this proxy is inaccessible from internet.

This means that whenever I connect from home WiFi I cannot open any page except internal network.

The solution is to click on Start, Control Panel, Network and Internet, Internet options, Connection, Local network setting and switch off proxy checkbox there. This procedure is annoying.

I would like to have some bat script that turns it off. Could you help me?


How do I switch off the proxy from a batch file?

Solution 1:

Use the following batch file:

@echo off
netsh winhttp reset proxy


Solution 2:

  1. Configure the proxy manually using the GUI, then export the registry entries for a disabled proxy [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings].

    See answer How can I change the system proxy from the command line? by zelanix for more information about this step.

    See also How to configure client proxy server settings by using a registry file by Microsoft.

  2. Write a batch file for subsequent use which:

    • Imports the registry file created as above.
    • Uses the netsh winhttp import proxy source=ie command.
  3. Use this batch file in future to disable your proxy.

Further Reading

| improve this answer | |
  • You're welcome. Please feel free to accept my answer. ;) – DavidPostill Oct 16 '15 at 15:49
  • Hmm, I found nothing. The script has no effect. Dump says: pushd winhttp reset proxy popd. Show proxy always says that I have direct access without proxy, even when proxy is set and turned on. Any idea? – Leos Literak Oct 16 '15 at 16:09
  • @LeosLiterak Answer expanded to outline a second solution. – DavidPostill Oct 16 '15 at 16:31
  • It seems that only this registry item changes: "ProxyEnable"=dword:00000001 – Leos Literak Oct 17 '15 at 13:48
  • @LeosLiterak That makes it a little easier then ;) – DavidPostill Oct 17 '15 at 13:56

I use the SETPROXY tool from the command line, or in combination with SlickRun, where I assigned some magic words using it. The author of both is the well respected original developer of Fiddler Eric Lawrence.


SETPROXY myproxyserver:8888
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.