changes on windows registry doesn’t take effect immediately

Discussion in 'Python' started by iMath, Mar 15, 2013.

  1. iMath

    iMath Guest

    changes on windows registry doesn’t take effect immediately

    I am trying to change IE’s proxy settings by the following 2 code snippets

    to enable the proxy by this code

    from winreg import *
    with OpenKey(HKEY_CURRENT_USER,r"Software\Microsoft\Windows\CurrentVersion\Internet Settings" ,0, KEY_ALL_ACCESS) as key:
    SetValueEx(key,"ProxyServer",0, REG_SZ, "127.0.0.1:8087")
    SetValueEx(key,"ProxyEnable",0, REG_DWORD, 1)
    SetValueEx(key,"ProxyOverride",0, REG_SZ, "<local>")
    FlushKey(key)

    to disable the proxy by this code

    from winreg import *
    with OpenKey(HKEY_CURRENT_USER,r"Software\Microsoft\Windows\CurrentVersion\Internet Settings" ,0, KEY_ALL_ACCESS) as key:

    DeleteValue(key,"ProxyServer")
    SetValueEx(key,"ProxyEnable",0, REG_DWORD, 0)
    DeleteValue(key,"ProxyOverride")
    FlushKey(key)

    but the changes on windows registry doesn’t take effect immediately,so isthere some way to change the windows registry and let the changes take effect immediately without restarting IE ?

    BTW ,I use the code on winxp ,and I am going to embed the 2 code snippets in my PyQt application .
    iMath, Mar 15, 2013
    #1
    1. Advertising

  2. Re: changes on windows registry doesn¢t takeeffect immediately

    On Thu, 14 Mar 2013 22:26:50 -0700, iMath wrote:

    > changes on windows registry doesn’t take effect immediately
    >
    > I am trying to change IE’s proxy settings by the following 2 code
    > snippets

    [...]
    > but the changes on windows registry doesn’t take effect immediately,so
    > is there some way to change the windows registry and let the changes
    > take effect immediately without restarting IE ?


    That's an IE question, not a Python question. You might be lucky and have
    somebody here happen to know the answer, but you'll probably have more
    luck asking on a group dedicated to Windows and IE.



    --
    Steven
    Steven D'Aprano, Mar 15, 2013
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leny
    Replies:
    3
    Views:
    16,900
    Daniel
    Feb 1, 2005
  2. sandorf
    Replies:
    10
    Views:
    483
    Christophe
    Dec 5, 2005
  3. Prabhat
    Replies:
    5
    Views:
    207
    Prabhat
    Oct 11, 2005
  4. Replies:
    0
    Views:
    117
  5. nolo contendere
    Replies:
    7
    Views:
    145
    Thomas 'PointedEars' Lahn
    Nov 9, 2007
Loading...

Share This Page