none
Disable proxy without opening IE RRS feed

  • Question

  • I'm very new to coding/scripting. I've made a pretty simple batch script to swap between wifi and ethernet. Everything works properly, but I'm running into an issue with disabling my proxy. It's enabled by group policy at work for use with my ethernet connection. When I run my script to enable wifi, I need to have it also disable my proxy so it doesn't prevent me from getting to webpages. I'm able to disable it through the registry setting, but the change doesn't kick in until I open Internet Explorer. Is there any way I can disable it from my batch script without needing to open IE to have the change apply? Many thanks for anyone who can help.
    Friday, July 17, 2015 8:44 PM

Answers

All replies

  • Put this in your batch script to disable proxy in IE:

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

    Friday, July 17, 2015 8:49 PM
  • Friday, July 17, 2015 8:50 PM
  • Not to be rude, but if you'd read my question in its entirety you would see that I've already tried this. It works, but the problem is that I don't want to have to open and close IE for the change to kick in.
    Monday, July 20, 2015 1:57 PM
  • netsh winhttp reset proxy doesn't work. I don't really know enough about this stuff to elaborate much, but it seems the netsh command is tied to some kind of different proxy settings. When my proxy is set through IE, the netsh command shows there is no proxy on and so it can't disable it.
    Monday, July 20, 2015 1:58 PM
  • Works fine for me. 

    Perhaps you should post in the proper forum for your issue.  I was going to post this first but thought I would just give you the answer.  If you are have issues beyond that then you need to post in the correct forum.  I would post in the end user forum or in the networking forum.


    \_(ツ)_/

    Monday, July 20, 2015 2:02 PM
  • Monday, July 20, 2015 2:04 PM
  • Hi Collekt.

    You can have a look at it.

    http://poshcode.org/2897  

    • Marked as answer by Collekt Tuesday, July 21, 2015 1:42 PM
    Monday, July 20, 2015 2:53 PM
  • Works fine for me. 

    Perhaps you should post in the proper forum for your issue.  I was going to post this first but thought I would just give you the answer.  If you are have issues beyond that then you need to post in the correct forum.  I would post in the end user forum or in the networking forum.


    \_(ツ)_/

    I assumed this would be a relevant place to ask this question since it's related to scripting. Is that not right?
    Tuesday, July 21, 2015 1:30 PM
  • Hi Collekt.

    You can have a look at it.

    Thanks for the link, this is the closest thing I've been able to find to a solution so far. It works, but it takes IE a very long time to open, disable the proxy, and then close. I have the same delay when doing it manually so it's no fault of the script. Maybe it's just something related to my PC, but the delay is why I was looking for a way to do it without actually opening IE. That script is still awesome though, thanks again.

    Edit: Appears to only happen when I turn off my ethernet connection and switch over to wifi, that's when it takes IE forever to load.

    • Edited by Collekt Tuesday, July 21, 2015 1:52 PM
    Tuesday, July 21, 2015 1:42 PM
  • The issue is that you are under a GPO on your domain.  When the GPO is not in use you have a hard time getting things to work.  You need to get your admins to set up the laptops for mobility so the proxy gets removed when you are not in the domain.  This should happen in reverse of what you are seeing.  The normal setting is to not have a proxy set.  When attached to the domain and you log into the system the GPO should set the proxy. 

    Check with your Network admin.  If they do not understand then post in the networking forum to learn how to manage mobile systems.


    \_(ツ)_/


    • Edited by jrv Tuesday, July 21, 2015 9:04 PM
    Tuesday, July 21, 2015 2:16 PM
  • The issue is that you are under a GPO on your domain.  When the GPO is not in use you have a hard time getting things to work.  YOU need to get your admins to set up the laptops for mobility so the proxy gets removed when you are not in the domain.  This should happen in reverse of what you are seeing.  The normal setting is to not have a proxy set.  When attached to the domain and you log into the system the GPOO should set the proxy. 

    Check with your Network admin.  If they do not understand then post in the networking forum to learn how to manage mobile systems.


    \_(ツ)_/

    Sorry if I interpret your use of caps on YOU wrong, but no need to get hostile about it. That's not even the issue, I understand how group policy works. I'm not having trouble swapping to wifi when I get home, I simply want my script to be able to swap to wifi and disable my proxy settings regardless of whether I'm at work, home, or whatever. It's purely a scripting question, I'm not looking for networking knowledge, group policy knowledge, etc. I just want to disable my proxy without needing to open IE, and that's all. Anyway, I got a solution that works well enough so thanks to everyone for the help.
    Tuesday, July 21, 2015 8:57 PM
  • Caps are a sticky shift key.

    What you are asking for cannot be done the way you want it to be done.  If you admins would set up the laptop and GPO correctly you wouldn't need to do this.


    \_(ツ)_/


    • Edited by jrv Tuesday, July 21, 2015 9:04 PM
    Tuesday, July 21, 2015 9:04 PM
  • Caps are a sticky shift key.

    What you are asking for cannot be done the way you want it to be done.  If you admins would set up the laptop and GPO correctly you wouldn't need to do this.


    \_(ツ)_/


    Fair enough. That's all I was trying to find out, how it could be done if it was possible.
    Tuesday, July 28, 2015 7:31 PM