Jump to content

problem with RegWrite win7


Recommended Posts

I use function "Enable" and "Disable" together in Win7. The first, I call function "Enable" , it's effect. Then "Disable" is called , but it's not effect. (In win XP is both of function are effect)

$key= "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settings"

Func Enable()

RegWrite($key,"ProxyEnable", "REG_DWORD",1)

DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)

EndFunc

Func Enable()

RegWrite($key,"ProxyEnable", "REG_DWORD",0)

DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)

EndFunc

Everyone help me, please!!! Thanks u very much

Edited by voanhkiem6
Link to comment
Share on other sites

  • Moderators

This works just fine on Win7 for me.

Global $key = "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settings"

Enable()
MsgBox(0, "", "Check Reg Key")
Disable()

Func Enable()
 
RegWrite($key,"ProxyEnable", "REG_DWORD",1)
DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
 
EndFunc


Func Disable()
 
RegWrite($key,"ProxyEnable", "REG_DWORD",0)
DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
 
EndFunc

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Is this the entire script? If not, it is possible that the $key variable is being assigned elsewhere in your script. Either declare it as a constant (i.e. Global Const) or use local variables to ensure $key is what you expect it to be. Also, are you sure that the problem is with RegWrite? Have you checked the registry value after disable is executed?

Edited by zorphnog
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...