Sign in to follow this  
Followers 0
voanhkiem6

problem with RegWrite win7

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



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

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0